mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-16 12:18:09 +00:00
Updated test application (MT5) to perform testing function ChartId and ChartRedraw
This commit is contained in:
@@ -498,6 +498,7 @@
|
|||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5">
|
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5">
|
||||||
@@ -511,9 +512,16 @@
|
|||||||
<Button Command="{Binding ChartXYToTimePriceCommand}" Content="ChartXYToTimePrice" Margin="2"/>
|
<Button Command="{Binding ChartXYToTimePriceCommand}" Content="ChartXYToTimePrice" Margin="2"/>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
|
|
||||||
<WrapPanel Grid.Row="2" VerticalAlignment="Top" Margin="5">
|
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="5">
|
||||||
|
<TextBlock Text="ChartID" VerticalAlignment="Center" Margin="2"/>
|
||||||
|
<TextBox Width="150" Text="{Binding ChartFunctionsChartIdValue}" Margin="2"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<WrapPanel Grid.Row="3" VerticalAlignment="Top" Margin="5">
|
||||||
<Button Command="{Binding ChartApplyTemplateCommand}" Content="ChartApplyTemplate" Margin="2"/>
|
<Button Command="{Binding ChartApplyTemplateCommand}" Content="ChartApplyTemplate" Margin="2"/>
|
||||||
<Button Command="{Binding ChartSaveTemplateCommand}" Content="ChartSaveTemplate" Margin="2"/>
|
<Button Command="{Binding ChartSaveTemplateCommand}" Content="ChartSaveTemplate" Margin="2"/>
|
||||||
|
<Button Command="{Binding ChartIdCommand}" Content="ChartId" Margin="2"/>
|
||||||
|
<Button Command="{Binding ChartRedrawCommand}" Content="ChartRedraw" Margin="2"/>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ namespace MtApi5TestClient
|
|||||||
public DelegateCommand ChartXYToTimePriceCommand { get; private set; }
|
public DelegateCommand ChartXYToTimePriceCommand { get; private set; }
|
||||||
public DelegateCommand ChartApplyTemplateCommand { get; private set; }
|
public DelegateCommand ChartApplyTemplateCommand { get; private set; }
|
||||||
public DelegateCommand ChartSaveTemplateCommand { get; private set; }
|
public DelegateCommand ChartSaveTemplateCommand { get; private set; }
|
||||||
|
public DelegateCommand ChartIdCommand { get; private set; }
|
||||||
|
public DelegateCommand ChartRedrawCommand { get; private set; }
|
||||||
|
|
||||||
public DelegateCommand TimeTradeServerCommand { get; private set; }
|
public DelegateCommand TimeTradeServerCommand { get; private set; }
|
||||||
public DelegateCommand TimeLocalCommand { get; private set; }
|
public DelegateCommand TimeLocalCommand { get; private set; }
|
||||||
@@ -195,6 +197,17 @@ namespace MtApi5TestClient
|
|||||||
OnPropertyChanged("ChartFunctionsSymbolValue");
|
OnPropertyChanged("ChartFunctionsSymbolValue");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long _chartFunctionsChartIdValue;
|
||||||
|
public long ChartFunctionsChartIdValue
|
||||||
|
{
|
||||||
|
get { return _chartFunctionsChartIdValue; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_chartFunctionsChartIdValue = value;
|
||||||
|
OnPropertyChanged("ChartFunctionsChartIdValue");
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
@@ -304,7 +317,8 @@ namespace MtApi5TestClient
|
|||||||
ChartXYToTimePriceCommand = new DelegateCommand(ExecuteChartXYToTimePrice);
|
ChartXYToTimePriceCommand = new DelegateCommand(ExecuteChartXYToTimePrice);
|
||||||
ChartApplyTemplateCommand = new DelegateCommand(ExecuteChartApplyTemplate);
|
ChartApplyTemplateCommand = new DelegateCommand(ExecuteChartApplyTemplate);
|
||||||
ChartSaveTemplateCommand = new DelegateCommand(ExecuteChartSaveTemplate);
|
ChartSaveTemplateCommand = new DelegateCommand(ExecuteChartSaveTemplate);
|
||||||
|
ChartIdCommand = new DelegateCommand(ExecuteChartId);
|
||||||
|
ChartRedrawCommand = new DelegateCommand(ExecuteChartRedraw);
|
||||||
|
|
||||||
TimeCurrentCommand = new DelegateCommand(ExecuteTimeCurrent);
|
TimeCurrentCommand = new DelegateCommand(ExecuteTimeCurrent);
|
||||||
TimeTradeServerCommand = new DelegateCommand(ExecuteTimeTradeServer);
|
TimeTradeServerCommand = new DelegateCommand(ExecuteTimeTradeServer);
|
||||||
@@ -1190,6 +1204,23 @@ namespace MtApi5TestClient
|
|||||||
|
|
||||||
AddLog($"ChartOpen: success chartid=>{result}");
|
AddLog($"ChartOpen: success chartid=>{result}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void ExecuteChartId(object o)
|
||||||
|
{
|
||||||
|
var result = await Execute(() => _mtApiClient.ChartId());
|
||||||
|
RunOnUiThread(() =>
|
||||||
|
{
|
||||||
|
ChartFunctionsChartIdValue = result;
|
||||||
|
});
|
||||||
|
AddLog($"ChartId: chartid = {result}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ExecuteChartRedraw(object o)
|
||||||
|
{
|
||||||
|
var chartId = ChartFunctionsChartIdValue;
|
||||||
|
_mtApiClient.ChartRedraw(chartId);
|
||||||
|
AddLog($"ChartRedraw: executed for chartid = {chartId}");
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private static void RunOnUiThread(Action action)
|
private static void RunOnUiThread(Action action)
|
||||||
|
|||||||
Binary file not shown.
+17
-17
@@ -5716,7 +5716,7 @@ void Execute_ChartClose()
|
|||||||
GET_LONG_VALUE(0, chart_id, "chart_id")
|
GET_LONG_VALUE(0, chart_id, "chart_id")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d", __FUNCTION__, chart_id);
|
PrintFormat("%s: chart_id = %I64d", __FUNCTION__, chart_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartClose(chart_id);
|
bool result = ChartClose(chart_id);
|
||||||
@@ -5751,7 +5751,7 @@ void Execute_ChartPeriod()
|
|||||||
GET_LONG_VALUE(0, chart_id, "chart_id")
|
GET_LONG_VALUE(0, chart_id, "chart_id")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d", __FUNCTION__, chart_id);
|
PrintFormat("%s: chart_id = %I64d", __FUNCTION__, chart_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ENUM_TIMEFRAMES period = ChartPeriod(chart_id);
|
ENUM_TIMEFRAMES period = ChartPeriod(chart_id);
|
||||||
@@ -5774,7 +5774,7 @@ void Execute_ChartSetDouble()
|
|||||||
GET_DOUBLE_VALUE(2, value, "value")
|
GET_DOUBLE_VALUE(2, value, "value")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, prop_id = %d, value = %f", __FUNCTION__, chart_id, prop_id, value);
|
PrintFormat("%s: chart_id = %I64d, prop_id = %d, value = %f", __FUNCTION__, chart_id, prop_id, value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartSetDouble(chart_id, (ENUM_CHART_PROPERTY_DOUBLE)prop_id, value);
|
bool result = ChartSetDouble(chart_id, (ENUM_CHART_PROPERTY_DOUBLE)prop_id, value);
|
||||||
@@ -5797,7 +5797,7 @@ void Execute_ChartSetInteger()
|
|||||||
GET_LONG_VALUE(2, value, "value")
|
GET_LONG_VALUE(2, value, "value")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, prop_id = %d, value = %d", __FUNCTION__, chart_id, prop_id, value);
|
PrintFormat("%s: chart_id = %I64d, prop_id = %d, value = %d", __FUNCTION__, chart_id, prop_id, value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartSetInteger(chart_id, (ENUM_CHART_PROPERTY_INTEGER)prop_id, value);
|
bool result = ChartSetInteger(chart_id, (ENUM_CHART_PROPERTY_INTEGER)prop_id, value);
|
||||||
@@ -5821,7 +5821,7 @@ void Execute_ChartSetString()
|
|||||||
GET_STRING_VALUE(2, value, "value")
|
GET_STRING_VALUE(2, value, "value")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, prop_id = %d, value = %s", __FUNCTION__, chart_id, prop_id, value);
|
PrintFormat("%s: chart_id = %I64d, prop_id = %d, value = %s", __FUNCTION__, chart_id, prop_id, value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartSetString(chart_id, (ENUM_CHART_PROPERTY_STRING)prop_id, value);
|
bool result = ChartSetString(chart_id, (ENUM_CHART_PROPERTY_STRING)prop_id, value);
|
||||||
@@ -5844,7 +5844,7 @@ void Execute_ChartGetDouble()
|
|||||||
GET_INT_VALUE(2, sub_window, "sub_window")
|
GET_INT_VALUE(2, sub_window, "sub_window")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, prop_id = %d, sub_window = %d", __FUNCTION__, chart_id, prop_id, sub_window);
|
PrintFormat("%s: chart_id = %I64d, prop_id = %d, sub_window = %d", __FUNCTION__, chart_id, prop_id, sub_window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
double result = ChartGetDouble(chart_id, (ENUM_CHART_PROPERTY_DOUBLE)prop_id, sub_window);
|
double result = ChartGetDouble(chart_id, (ENUM_CHART_PROPERTY_DOUBLE)prop_id, sub_window);
|
||||||
@@ -5867,7 +5867,7 @@ void Execute_ChartGetInteger()
|
|||||||
GET_INT_VALUE(2, sub_window, "sub_window")
|
GET_INT_VALUE(2, sub_window, "sub_window")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, prop_id = %d, sub_window = %d", __FUNCTION__, chart_id, prop_id, sub_window);
|
PrintFormat("%s: chart_id = %I64d, prop_id = %d, sub_window = %d", __FUNCTION__, chart_id, prop_id, sub_window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
long result = ChartGetInteger(chart_id, (ENUM_CHART_PROPERTY_INTEGER)prop_id, sub_window);
|
long result = ChartGetInteger(chart_id, (ENUM_CHART_PROPERTY_INTEGER)prop_id, sub_window);
|
||||||
@@ -5888,7 +5888,7 @@ void Execute_ChartGetString()
|
|||||||
GET_INT_VALUE(1, prop_id, "prop_id")
|
GET_INT_VALUE(1, prop_id, "prop_id")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, prop_id = %d", __FUNCTION__, chart_id, prop_id);
|
PrintFormat("%s: chart_id = %I64d, prop_id = %d", __FUNCTION__, chart_id, prop_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
string result = ChartGetString(chart_id, (ENUM_CHART_PROPERTY_STRING)prop_id);
|
string result = ChartGetString(chart_id, (ENUM_CHART_PROPERTY_STRING)prop_id);
|
||||||
@@ -5913,7 +5913,7 @@ void Execute_ChartNavigate()
|
|||||||
GET_INT_VALUE(2, shift, "shift")
|
GET_INT_VALUE(2, shift, "shift")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, position = %d, shift = %d", __FUNCTION__, chart_id, position, shift);
|
PrintFormat("%s: chart_id = %I64d, position = %d, shift = %d", __FUNCTION__, chart_id, position, shift);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartNavigate(chart_id, (ENUM_CHART_POSITION)position, shift);
|
bool result = ChartNavigate(chart_id, (ENUM_CHART_POSITION)position, shift);
|
||||||
@@ -5937,7 +5937,7 @@ void Execute_ChartIndicatorDelete()
|
|||||||
GET_STRING_VALUE(2, indicator_shortname, "indicator_shortname")
|
GET_STRING_VALUE(2, indicator_shortname, "indicator_shortname")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, sub_window = %d, indicator_shortname = %s", __FUNCTION__, chart_id, sub_window, indicator_shortname);
|
PrintFormat("%s: chart_id = %I64d, sub_window = %d, indicator_shortname = %s", __FUNCTION__, chart_id, sub_window, indicator_shortname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartIndicatorDelete( chart_id, sub_window, indicator_shortname);
|
bool result = ChartIndicatorDelete( chart_id, sub_window, indicator_shortname);
|
||||||
@@ -5960,7 +5960,7 @@ void Execute_ChartIndicatorName()
|
|||||||
GET_INT_VALUE(2, index, "index")
|
GET_INT_VALUE(2, index, "index")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, sub_window = %d, index = %d", __FUNCTION__, chart_id, sub_window, index);
|
PrintFormat("%s: chart_id = %I64d, sub_window = %d, index = %d", __FUNCTION__, chart_id, sub_window, index);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
string result = ChartIndicatorName(chart_id, sub_window, index);
|
string result = ChartIndicatorName(chart_id, sub_window, index);
|
||||||
@@ -5981,7 +5981,7 @@ void Execute_ChartIndicatorsTotal()
|
|||||||
GET_INT_VALUE(1, sub_window, "sub_window")
|
GET_INT_VALUE(1, sub_window, "sub_window")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, sub_window = %d", __FUNCTION__, chart_id, sub_window);
|
PrintFormat("%s: chart_id = %I64d, sub_window = %d", __FUNCTION__, chart_id, sub_window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int result = ChartIndicatorsTotal(chart_id, sub_window);
|
int result = ChartIndicatorsTotal(chart_id, sub_window);
|
||||||
@@ -6060,7 +6060,7 @@ void Execute_ChartSetSymbolPeriod()
|
|||||||
GET_INT_VALUE(2, period, "period")
|
GET_INT_VALUE(2, period, "period")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, symbol = %s, period = %d", __FUNCTION__, chart_id, symbol, period);
|
PrintFormat("%s: chart_id = %I64d, symbol = %s, period = %d", __FUNCTION__, chart_id, symbol, period);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartSetSymbolPeriod(chart_id, symbol, (ENUM_TIMEFRAMES)period);
|
bool result = ChartSetSymbolPeriod(chart_id, symbol, (ENUM_TIMEFRAMES)period);
|
||||||
@@ -6088,7 +6088,7 @@ void Execute_ChartScreenShot()
|
|||||||
GET_INT_VALUE(4, align_mode, "align_mode")
|
GET_INT_VALUE(4, align_mode, "align_mode")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, filename = %s, width = %d, height = %d, align_mode = %d", __FUNCTION__, chart_id, filename, width, height, align_mode);
|
PrintFormat("%s: chart_id = %I64d, filename = %s, width = %d, height = %d, align_mode = %d", __FUNCTION__, chart_id, filename, width, height, align_mode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result = ChartScreenShot(chart_id, filename, width, height, (ENUM_ALIGN_MODE)align_mode);
|
bool result = ChartScreenShot(chart_id, filename, width, height, (ENUM_ALIGN_MODE)align_mode);
|
||||||
@@ -6166,7 +6166,7 @@ void Execute_ChartWindowFind()
|
|||||||
GET_STRING_VALUE(1, indicator_shortname, "indicator_shortname")
|
GET_STRING_VALUE(1, indicator_shortname, "indicator_shortname")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d, indicator_shortname = %s", __FUNCTION__, chart_id, indicator_shortname);
|
PrintFormat("%s: chart_id = %I64d, indicator_shortname = %s", __FUNCTION__, chart_id, indicator_shortname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int result = ChartWindowFind(chart_id, indicator_shortname);
|
int result = ChartWindowFind(chart_id, indicator_shortname);
|
||||||
@@ -6234,7 +6234,7 @@ void Execute_ChartId()
|
|||||||
long id = ChartID();
|
long id = ChartID();
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: id = %d", __FUNCTION__, id);
|
PrintFormat("%s: id = %I64d", __FUNCTION__, id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SEND_LONG_RESPONSE(id)
|
SEND_LONG_RESPONSE(id)
|
||||||
@@ -6246,7 +6246,7 @@ void Execute_ChartRedraw()
|
|||||||
GET_LONG_VALUE(0, chart_id, "chart_id")
|
GET_LONG_VALUE(0, chart_id, "chart_id")
|
||||||
|
|
||||||
#ifdef __DEBUG_LOG__
|
#ifdef __DEBUG_LOG__
|
||||||
PrintFormat("%s: chart_id = %d", __FUNCTION__, chart_id);
|
PrintFormat("%s: chart_id = %I64d", __FUNCTION__, chart_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ChartRedraw(chart_id);
|
ChartRedraw(chart_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user