Implemented function Alert (MT5)

This commit is contained in:
vdemydiuk
2018-03-13 18:24:40 +02:00
parent 16f454ca61
commit 9afd30e463
6 changed files with 63 additions and 15 deletions
+10
View File
@@ -70,6 +70,7 @@ namespace MtApi5TestClient
public DelegateCommand GetLastErrorCommand { get; private set; }
public DelegateCommand ResetLastErrorCommand { get; private set; }
public DelegateCommand PrintCommand { get; private set; }
public DelegateCommand AlertCommand { get; private set; }
public DelegateCommand iCustomCommand { get; private set; }
@@ -425,6 +426,7 @@ namespace MtApi5TestClient
PositionOpenCommand = new DelegateCommand(ExecutePositionOpen);
PrintCommand = new DelegateCommand(ExecutePrint);
AlertCommand = new DelegateCommand(ExecuteAlert);
GetLastErrorCommand = new DelegateCommand(ExecuteGetLastError);
ResetLastErrorCommand = new DelegateCommand(ExecuteResetLastError);
@@ -1136,6 +1138,14 @@ namespace MtApi5TestClient
AddLog($"Print: message print in MetaTrader - {retVal}");
}
private void ExecuteAlert(object obj)
{
var message = MessageText;
_mtApiClient.Alert(message);
AddLog($"Alert: send alert to MetaTrader - {message}.");
}
private async void ExecuteGetLastError(object obj)
{
var retVal = await Execute(() => _mtApiClient.GetLastError());