bool CloseSide(const bool isBuy, const string why)
{
bool anyFailed = false;
for(int i = Posit ...
bool CloseSide(const bool isBuy, const string why)
{
bool anyFailed = false;
for(int i = PositionsTotal() - 1; i >= 0; i--) {
...
if(!ClosePositionRetry(ticket, "方向平仓")) anyFailed = true;
}
if(!anyFailed) DeletePendings(isBuy); // 全平成功才删挂单
PrintFormat(...);
return !anyFailed;
} |
|
|
|
|
|
|
|