Issue #107: Added function PositionCloseAll

This commit is contained in:
vdemydiuk
2018-06-06 14:24:39 +03:00
parent 897892dc89
commit 0c38d37559
6 changed files with 47 additions and 5 deletions
+2 -1
View File
@@ -250,6 +250,7 @@ namespace MtApi5
GlobalVariablesDeleteAll = 157,
GlobalVariablesTotal = 158,
UnlockTicks = 159
UnlockTicks = 159,
PositionCloseAll = 160
}
}
+9
View File
@@ -521,11 +521,20 @@ namespace MtApi5
///<summary>
///Close all open positions.
///</summary>
[Obsolete("OrderCloseAll is deprecated, please use PositionCloseAll instead.")]
public bool OrderCloseAll()
{
return SendCommand<bool>(Mt5CommandType.OrderCloseAll, null);
}
///<summary>
///Close all open positions. Returns count of closed positions.
///</summary>
public int PositionCloseAll()
{
return SendCommand<int>(Mt5CommandType.PositionCloseAll, null);
}
///<summary>
///Closes a position with the specified ticket.
///</summary>