last ...
This commit is contained in:
@@ -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 ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user