last worsk ...
This commit is contained in:
@@ -372,13 +372,15 @@ struct X121SMCTradeData
|
||||
//
|
||||
double pVolume = _position.volume;
|
||||
double pSL = NormalizePrice(_position.sl, _position.symbol);
|
||||
double pTP = NormalizePrice(_position.tp, _position.symbol);
|
||||
double pEntry = NormalizePrice(_position.entry, _position.symbol);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsValid() &&
|
||||
sl == pSL &&
|
||||
(sl == pSL ||
|
||||
tp == pTP) &&
|
||||
entry == pEntry &&
|
||||
pVolume == volume &&
|
||||
_position.IsValid() &&
|
||||
@@ -389,6 +391,17 @@ struct X121SMCTradeData
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsValid() &&
|
||||
_position.IsValid() &&
|
||||
_position.ticket == signal.positionId;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -3324,6 +3337,21 @@ class XC121SMCTradeHandler : public XCBaseAlert
|
||||
" PC (" + ToString(closeVolume) + ") On TP Level: " +
|
||||
ToString(partialCloseOnTP) + " Successfully ...";
|
||||
Alert(message);
|
||||
|
||||
//
|
||||
// Finish Position ...
|
||||
if (closeVolume == mainVolume)
|
||||
{
|
||||
//
|
||||
Finish(
|
||||
iPosition.ticket,
|
||||
iPosition,
|
||||
comment //
|
||||
);
|
||||
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3419,6 +3447,19 @@ class XC121SMCTradeHandler : public XCBaseAlert
|
||||
);
|
||||
if (IsValidSize(closedPositionsCount))
|
||||
{
|
||||
//
|
||||
// Finish Positions and Clear Data ...
|
||||
for (int i = 0; i < ArraySize(positions); i++)
|
||||
{
|
||||
//
|
||||
XPosition iPosition = positions[i];
|
||||
Finish(
|
||||
iPosition.ticket,
|
||||
iPosition,
|
||||
comment //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
string message = "Hedge (" + ToString(count) + ") Positions By: " +
|
||||
ToString(profitSummary) + " Successfully ...";
|
||||
|
||||
Reference in New Issue
Block a user