last ...
This commit is contained in:
@@ -5009,23 +5009,36 @@ private:
|
||||
int maxInDIDX = FindMaxDrawdownIndex(
|
||||
positions //
|
||||
);
|
||||
if (IsValidIndex(maxInDIDX))
|
||||
int setupIDX = FindSetupIndex(positions[maxInDIDX].symbol);
|
||||
if (IsValidIndex(maxInDIDX) && IsValidIndex(setupIDX))
|
||||
{
|
||||
//
|
||||
string comment = XEQMSupportToken + " Close Max In D ...";
|
||||
bool isClosed = mTrader.Close(
|
||||
positions[maxInDIDX].ticket,
|
||||
comment //
|
||||
);
|
||||
if (isClosed)
|
||||
// Check Position Age ...
|
||||
int age = GetAge(
|
||||
positions[maxInDIDX],
|
||||
mSetups[setupIDX].GetPeriod(););
|
||||
if (age >= 700)
|
||||
{
|
||||
//
|
||||
string message = XEQMSupportToken + " Close Position (" + ToString(positions[maxInDIDX].ticket) + ") Due Max In Drawdown ...";
|
||||
Alert(message);
|
||||
string comment = XEQMSupportToken + " Close Max In D ...";
|
||||
bool isClosed = mTrader.Close(
|
||||
positions[maxInDIDX].ticket,
|
||||
comment //
|
||||
);
|
||||
if (isClosed)
|
||||
{
|
||||
//
|
||||
string message = XEQMSupportToken + " Close Position (" + ToString(positions[maxInDIDX].ticket) + ") Due Max In Drawdown ...";
|
||||
Alert(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Find Max In Profit ...
|
||||
// and Min In Profit ...
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user