Issue #100: implemented functions GetLastError, ResetLastError() in MtApi (MT5)

This commit is contained in:
vdemydiuk
2018-03-09 19:18:54 +02:00
parent ec6c71607b
commit cab2de6d24
7 changed files with 113 additions and 13 deletions
+16
View File
@@ -60,6 +60,8 @@ namespace MtApi5TestClient
public DelegateCommand PositionOpenCommand { get; private set; }
public DelegateCommand GetLastErrorCommand { get; private set; }
public DelegateCommand ResetLastErrorCommand { get; private set; }
public DelegateCommand PrintCommand { get; private set; }
public DelegateCommand iCustomCommand { get; private set; }
@@ -257,6 +259,8 @@ namespace MtApi5TestClient
PositionOpenCommand = new DelegateCommand(ExecutePositionOpen);
PrintCommand = new DelegateCommand(ExecutePrint);
GetLastErrorCommand = new DelegateCommand(ExecuteGetLastError);
ResetLastErrorCommand = new DelegateCommand(ExecuteResetLastError);
iCustomCommand = new DelegateCommand(ExecuteICustom);
@@ -926,6 +930,18 @@ namespace MtApi5TestClient
AddLog($"Print: message print in MetaTrader - {retVal}");
}
private async void ExecuteGetLastError(object obj)
{
var retVal = await Execute(() => _mtApiClient.GetLastError());
AddLog($"GetLastError: last error = {retVal}");
}
private void ExecuteResetLastError(object obj)
{
_mtApiClient.ResetLastError();
AddLog("GetLastError: executed.");
}
private async void ExecuteICustom(object o)
{
const string symbol = "EURUSD";