mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-08 00:17:49 +00:00
Issue #284: MtApi5/MQL5 - added function GetSymbols
This commit is contained in:
@@ -160,6 +160,8 @@ namespace MtApi5TestClient
|
||||
public DelegateCommand GlobalVariablesTotalCommand { get; private set; }
|
||||
|
||||
public DelegateCommand UnlockTicksCommand { get; private set; }
|
||||
|
||||
public DelegateCommand GetSymbolsCommand { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
@@ -314,6 +316,19 @@ namespace MtApi5TestClient
|
||||
OnPropertyChanged("PositionTicketValue");
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetSymbolsSelected { get; set; } = false;
|
||||
|
||||
private List<string> _symbols;
|
||||
public List<string> Symbols
|
||||
{
|
||||
get { return _symbols; }
|
||||
set
|
||||
{
|
||||
_symbols = value;
|
||||
OnPropertyChanged("Symbols");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
@@ -475,6 +490,8 @@ namespace MtApi5TestClient
|
||||
GlobalVariablesTotalCommand = new DelegateCommand(ExecuteGlobalVariablesTotal);
|
||||
|
||||
UnlockTicksCommand = new DelegateCommand(ExecuteUnlockTicks);
|
||||
|
||||
GetSymbolsCommand = new DelegateCommand(ExecuteGetSymbols);
|
||||
}
|
||||
|
||||
private bool CanExecuteConnect(object o)
|
||||
@@ -1726,6 +1743,19 @@ namespace MtApi5TestClient
|
||||
_mtApiClient.UnlockTicks();
|
||||
}
|
||||
|
||||
private async void ExecuteGetSymbols(object o)
|
||||
{
|
||||
var result = await Execute(() => _mtApiClient.GetSymbols(GetSymbolsSelected));
|
||||
if (result == null)
|
||||
return;
|
||||
|
||||
AddLog($"ChartScreenShot: {result.Count} count of symbols");
|
||||
RunOnUiThread(() =>
|
||||
{
|
||||
Symbols = result;
|
||||
});
|
||||
}
|
||||
|
||||
private static void RunOnUiThread(Action action)
|
||||
{
|
||||
Application.Current?.Dispatcher.Invoke(action);
|
||||
|
||||
Reference in New Issue
Block a user