Updated test application (MT5) to perform testing function ChartWindowFind and ChartClose

This commit is contained in:
vdemydiuk
2018-03-19 17:23:16 +02:00
parent 4aefdd554b
commit f17c7cd554
2 changed files with 21 additions and 0 deletions
@@ -522,6 +522,8 @@
<Button Command="{Binding ChartSaveTemplateCommand}" Content="ChartSaveTemplate" Margin="2"/>
<Button Command="{Binding ChartIdCommand}" Content="ChartId" Margin="2"/>
<Button Command="{Binding ChartRedrawCommand}" Content="ChartRedraw" Margin="2"/>
<Button Command="{Binding ChartWindowFindCommand}" Content="ChartWindowFind" Margin="2"/>
<Button Command="{Binding ChartCloseCommand}" Content="ChartClose" Margin="2"/>
</WrapPanel>
</Grid>
</TabItem>
+19
View File
@@ -83,6 +83,8 @@ namespace MtApi5TestClient
public DelegateCommand ChartSaveTemplateCommand { get; private set; }
public DelegateCommand ChartIdCommand { get; private set; }
public DelegateCommand ChartRedrawCommand { get; private set; }
public DelegateCommand ChartWindowFindCommand { get; private set; }
public DelegateCommand ChartCloseCommand { get; private set; }
public DelegateCommand TimeTradeServerCommand { get; private set; }
public DelegateCommand TimeLocalCommand { get; private set; }
@@ -319,6 +321,8 @@ namespace MtApi5TestClient
ChartSaveTemplateCommand = new DelegateCommand(ExecuteChartSaveTemplate);
ChartIdCommand = new DelegateCommand(ExecuteChartId);
ChartRedrawCommand = new DelegateCommand(ExecuteChartRedraw);
ChartWindowFindCommand = new DelegateCommand(ExecuteChartWindowFind);
ChartCloseCommand = new DelegateCommand(ExecuteChartClose);
TimeCurrentCommand = new DelegateCommand(ExecuteTimeCurrent);
TimeTradeServerCommand = new DelegateCommand(ExecuteTimeTradeServer);
@@ -1221,6 +1225,21 @@ namespace MtApi5TestClient
_mtApiClient.ChartRedraw(chartId);
AddLog($"ChartRedraw: executed for chartid = {chartId}");
}
private async void ExecuteChartWindowFind(object o)
{
const string shortname = "MACD(12,26,9)";
var chartId = ChartFunctionsChartIdValue;
var result = await Execute(() => _mtApiClient.ChartWindowFind(chartId, shortname));
AddLog($"ChartRedraw: result {result} for chartid = {chartId}");
}
private async void ExecuteChartClose(object o)
{
var chartId = ChartFunctionsChartIdValue;
var result = await Execute(() => _mtApiClient.ChartClose(chartId));
AddLog($"ChartClose: result {result} for chartid = {chartId}");
}
#endregion
private static void RunOnUiThread(Action action)