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( 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 ...
// //
} }