This commit is contained in:
2025-01-15 22:09:21 +03:30
parent 341992374c
commit 9b307ae6e6
12 changed files with 3448 additions and 671 deletions
@@ -3276,7 +3276,7 @@ class XC121SMCTradeHandler : public XCBaseAlert
//
// Handle Last Executed Signal ...
HandleSignalExecuted(signal);
HandleSignalExecuted(signal);
//
// Alert Executed Signal ...
@@ -3376,6 +3376,66 @@ class XC121SMCTradeHandler : public XCBaseAlert
return result;
}
/**
* Force Close Positions ...
*
* @return ( bool )
*/
bool ForceClose(
XPosition &positions[],
string comment,
string notificationMessage //
)
{
//
bool result = false;
//
int count = ArraySize(positions);
result = IsValidSize(count);
if (!result)
{
return result;
}
//
int closedPositionsCount = mTrader.Close(
positions,
comment //
);
result = IsValidSize(closedPositionsCount);
if (result)
{
//
// Finish Positions and Clear Data ...
for (int i = 0; i < ArraySize(positions); i++)
{
//
XPosition iPosition = positions[i];
Finish(
iPosition.ticket,
iPosition,
comment //
);
}
//
ResetProtections();
//
if (IsValid(notificationMessage))
{
Alert(notificationMessage);
}
}
//
return result;
//
return result;
}
//
// Timing Actions ...