diff --git a/MtApi5/MqlTradeResult.cs b/MtApi5/MqlTradeResult.cs index 793c78f8..d9e8e8e6 100755 --- a/MtApi5/MqlTradeResult.cs +++ b/MtApi5/MqlTradeResult.cs @@ -23,6 +23,11 @@ public MqlTradeResult(uint retcode, ulong deal, ulong order, double volume, doub public double Bid { get; private set; } // Current Bid price public double Ask { get; private set; } // Current Ask price public string Comment { get; private set; } // Broker comment to operation (by default it is filled by the operation description) - public uint Request_id { get; private set; } // Request ID set by the terminal during the dispatch + public uint Request_id { get; private set; } // Request ID set by the terminal during the dispatch + + public override string ToString() + { + return $"Retcode={Retcode}; Deal={Deal}; Order={Order}; Volume={Volume}; Price={Price}; Bid={Bid}; Ask={Ask}; Comment={Comment}; Request_id={Request_id}"; + } } } diff --git a/TestClients/MtApi5TestClient/ViewModel.cs b/TestClients/MtApi5TestClient/ViewModel.cs index 4ba90b2e..04b356ca 100755 --- a/TestClients/MtApi5TestClient/ViewModel.cs +++ b/TestClients/MtApi5TestClient/ViewModel.cs @@ -745,13 +745,14 @@ private async void ExecutePositionOpen(object obj) const string symbol = "EURUSD"; const ENUM_ORDER_TYPE orderType = ENUM_ORDER_TYPE.ORDER_TYPE_BUY; const double volume = 0.1; - const double price = 1.013; - const double sl = 1.00; - const double tp = 1.020; + const double price = 1.18129; + const double sl = 1.1811; + const double tp = 1.1814; const string comment = "Test PositionOpen"; + MqlTradeResult tradeResult = null; - var retVal = await Execute (() => _mtApiClient.PositionOpen(symbol, orderType, volume, price, sl, tp, comment)); - AddLog($"PositionOpen: symbol EURUSD result = {retVal}"); + var retVal = await Execute (() => _mtApiClient.PositionOpen(symbol, orderType, volume, price, sl, tp, comment, out tradeResult)); + AddLog($"PositionOpen: symbol EURUSD retVal = {retVal}, result = {tradeResult}"); } private async void ExecutePrint(object obj)