Issue #14: Updated test application for using function PositionOpen with MqlTradeResult

This commit is contained in:
DW
2017-09-29 19:05:06 +03:00
parent cd24891022
commit b838084ba2
2 changed files with 12 additions and 6 deletions
+6 -1
View File
@@ -23,6 +23,11 @@
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}";
}
}
}
+6 -5
View File
@@ -745,13 +745,14 @@ namespace MtApi5TestClient
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)