diff --git a/TestClients/MtApi5TestClient/MainWindow.xaml b/TestClients/MtApi5TestClient/MainWindow.xaml
index e3d7d645..d4c904b5 100755
--- a/TestClients/MtApi5TestClient/MainWindow.xaml
+++ b/TestClients/MtApi5TestClient/MainWindow.xaml
@@ -440,20 +440,20 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -536,7 +536,9 @@
+
+
diff --git a/TestClients/MtApi5TestClient/ViewModel.cs b/TestClients/MtApi5TestClient/ViewModel.cs
index 12493732..c309b4bd 100755
--- a/TestClients/MtApi5TestClient/ViewModel.cs
+++ b/TestClients/MtApi5TestClient/ViewModel.cs
@@ -92,7 +92,9 @@ namespace MtApi5TestClient
public DelegateCommand ChartGetDoubleCommand { get; private set; }
public DelegateCommand ChartGetIntegerCommand { get; private set; }
public DelegateCommand ChartNavigateCommand { get; private set; }
+ public DelegateCommand ChartIndicatorAddCommand { get; private set; }
public DelegateCommand ChartIndicatorDeleteCommand { get; private set; }
+ public DelegateCommand ChartIndicatorGetCommand { get; private set; }
public DelegateCommand ChartIndicatorNameCommand { get; private set; }
public DelegateCommand ChartIndicatorsTotalCommand { get; private set; }
public DelegateCommand ChartWindowOnDroppedCommand { get; private set; }
@@ -347,7 +349,9 @@ namespace MtApi5TestClient
ChartGetDoubleCommand = new DelegateCommand(ExecuteChartGetDouble);
ChartGetIntegerCommand = new DelegateCommand(ExecuteChartGetInteger);
ChartNavigateCommand = new DelegateCommand(ExecuteChartNavigate);
+ ChartIndicatorAddCommand = new DelegateCommand(ExecuteChartIndicatorAdd);
ChartIndicatorDeleteCommand = new DelegateCommand(ExecuteChartIndicatorDelete);
+ ChartIndicatorGetCommand = new DelegateCommand(ExecuteChartIndicatorGet);
ChartIndicatorNameCommand = new DelegateCommand(ExecuteChartIndicatorName);
ChartIndicatorsTotalCommand = new DelegateCommand(ExecuteChartIndicatorsTotal);
ChartWindowOnDroppedCommand = new DelegateCommand(ExecuteChartWindowOnDropped);
@@ -1324,6 +1328,16 @@ namespace MtApi5TestClient
AddLog($"ChartNavigate: result {result} for chartid {chartId}");
}
+ private async void ExecuteChartIndicatorAdd(object obj)
+ {
+ var chartId = ChartFunctionsChartIdValue;
+ var symbol = ChartFunctionsSymbolValue;
+
+ var indicatorHandle = await Execute(() => _mtApiClient.iMACD(symbol, ENUM_TIMEFRAMES.PERIOD_CURRENT, 12, 26, 9, ENUM_APPLIED_PRICE.PRICE_CLOSE));
+ var result = await Execute(() => _mtApiClient.ChartIndicatorAdd(chartId, 1, indicatorHandle));
+ AddLog($"ChartIndicatorAdd: result {result} for chartid {chartId} with indicator {indicatorHandle}");
+ }
+
private async void ExecuteChartIndicatorDelete(object o)
{
const string shortname = "MACD(12,26,9)";
@@ -1332,6 +1346,14 @@ namespace MtApi5TestClient
AddLog($"ChartIndicatorDelete: result {result} for chartid {chartId}");
}
+ private async void ExecuteChartIndicatorGet(object obj)
+ {
+ const string shortname = "MACD(12,26,9)";
+ var chartId = ChartFunctionsChartIdValue;
+ var result = await Execute(() => _mtApiClient.ChartIndicatorGet(chartId, 1, shortname));
+ AddLog($"hartIndicatorGet: result {result} for chartid {chartId}");
+ }
+
private async void ExecuteChartIndicatorName(object obj)
{
var chartId = ChartFunctionsChartIdValue;
diff --git a/mq5/MtApi5.ex5 b/mq5/MtApi5.ex5
index 63ccdc58..aa1b6849 100755
Binary files a/mq5/MtApi5.ex5 and b/mq5/MtApi5.ex5 differ
diff --git a/mq5/MtApi5.mq5 b/mq5/MtApi5.mq5
index 1517d9af..c009c721 100644
--- a/mq5/MtApi5.mq5
+++ b/mq5/MtApi5.mq5
@@ -6113,8 +6113,8 @@ void Execute_ChartIndicatorAdd()
int indicator_handle;
GET_LONG_VALUE(0, chart_id, "chart_id")
- GET_INT_VALUE(2, sub_window, "sub_window")
- GET_INT_VALUE(3, indicator_handle, "indicator_handle")
+ GET_INT_VALUE(1, sub_window, "sub_window")
+ GET_INT_VALUE(2, indicator_handle, "indicator_handle")
#ifdef __DEBUG_LOG__
PrintFormat("%s: chart_id = %I64d, sub_window = %d, indicator_handle = %d", __FUNCTION__, chart_id, sub_window, indicator_handle);