From 9800177b080db6c01b1b237a02e8f7ce0bae1862 Mon Sep 17 00:00:00 2001 From: DW Date: Tue, 29 Aug 2017 17:40:23 +0300 Subject: [PATCH] Issue #57: Added function PositionSelectByTicket into C# code --- MtApi5/Mt5CommandType.cs | 2 ++ MtApi5/MtApi5Client.cs | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/MtApi5/Mt5CommandType.cs b/MtApi5/Mt5CommandType.cs index 3b468ebc..8a8aab49 100755 --- a/MtApi5/Mt5CommandType.cs +++ b/MtApi5/Mt5CommandType.cs @@ -114,5 +114,7 @@ namespace MtApi5 //Requests MtRequest = 155, + + PositionSelectByTicket = 69 } } diff --git a/MtApi5/MtApi5Client.cs b/MtApi5/MtApi5Client.cs index 8352c369..33bf084b 100755 --- a/MtApi5/MtApi5Client.cs +++ b/MtApi5/MtApi5Client.cs @@ -223,6 +223,17 @@ namespace MtApi5 return SendCommand(Mt5CommandType.PositionSelect, commandParameters); } + /// + ///Selects an open position to work with based on the ticket number specified in the position. If successful, returns true. Returns false if the function failed. + /// + ///Position ticket. + public bool PositionSelectByTicket(ulong ticket) + { + var commandParameters = new ArrayList { ticket }; + + return SendCommand(Mt5CommandType.PositionSelectByTicket, commandParameters); + } + /// ///The function returns the requested property of an open position, pre-selected using PositionGetSymbol or PositionSelect. ///