This commit is contained in:
2024-06-24 11:17:18 +03:30
parent 2d817b10ef
commit 85ba097546
+22 -9
View File
@@ -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 ...
//
}