last ...
This commit is contained in:
@@ -5009,23 +5009,36 @@ private:
|
|||||||
int maxInDIDX = FindMaxDrawdownIndex(
|
int maxInDIDX = FindMaxDrawdownIndex(
|
||||||
positions //
|
positions //
|
||||||
);
|
);
|
||||||
if (IsValidIndex(maxInDIDX))
|
int setupIDX = FindSetupIndex(positions[maxInDIDX].symbol);
|
||||||
|
if (IsValidIndex(maxInDIDX) && IsValidIndex(setupIDX))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
string comment = XEQMSupportToken + " Close Max In D ...";
|
// Check Position Age ...
|
||||||
bool isClosed = mTrader.Close(
|
int age = GetAge(
|
||||||
positions[maxInDIDX].ticket,
|
positions[maxInDIDX],
|
||||||
comment //
|
mSetups[setupIDX].GetPeriod(););
|
||||||
);
|
if (age >= 700)
|
||||||
if (isClosed)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
string message = XEQMSupportToken + " Close Position (" + ToString(positions[maxInDIDX].ticket) + ") Due Max In Drawdown ...";
|
string comment = XEQMSupportToken + " Close Max In D ...";
|
||||||
Alert(message);
|
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