diff --git a/MtApi5/Mt5CommandType.cs b/MtApi5/Mt5CommandType.cs index 535c00f8..22542cb8 100755 --- a/MtApi5/Mt5CommandType.cs +++ b/MtApi5/Mt5CommandType.cs @@ -9,7 +9,6 @@ namespace MtApi5 //OrderSend = 1, OrderCalcMargin = 2, OrderCalcProfit = 3, - //OrderCheck = 4, //OrderSendAsync = 5, PositionsTotal = 6, PositionGetSymbol = 7, @@ -17,6 +16,7 @@ namespace MtApi5 PositionGetDouble = 9, PositionGetInteger = 10, PositionGetString = 11, + PositionGetTicket = 4, OrdersTotal = 12, OrderGetTicket = 13, OrderSelect = 14, diff --git a/MtApi5/MtApi5Client.cs b/MtApi5/MtApi5Client.cs index cace0973..cc4c0dda 100755 --- a/MtApi5/MtApi5Client.cs +++ b/MtApi5/MtApi5Client.cs @@ -280,6 +280,17 @@ namespace MtApi5 return SendCommand(Mt5CommandType.PositionGetString, commandParameters); } + /// + ///The function returns the ticket of a position with the specified index in the list of open positions and automatically selects the position to work with using functions PositionGetDouble, PositionGetInteger, PositionGetString. + /// + ///Identifier of a position property. + public ulong PositionGetTicket(int index) + { + var commandParameters = new ArrayList { index }; + + return SendCommand(Mt5CommandType.PositionGetTicket, commandParameters); + } + /// ///Returns the number of current orders. /// diff --git a/TestClients/MtApi5TestClient/MainWindow.xaml b/TestClients/MtApi5TestClient/MainWindow.xaml index bdbf6e51..efe01736 100755 --- a/TestClients/MtApi5TestClient/MainWindow.xaml +++ b/TestClients/MtApi5TestClient/MainWindow.xaml @@ -240,6 +240,7 @@