diff --git a/TestClients/MtApi5TestClient/MainWindow.xaml b/TestClients/MtApi5TestClient/MainWindow.xaml
index 113f6afd..bdbf6e51 100755
--- a/TestClients/MtApi5TestClient/MainWindow.xaml
+++ b/TestClients/MtApi5TestClient/MainWindow.xaml
@@ -84,6 +84,13 @@
+
+
+
+
+
+
@@ -305,32 +312,37 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/TestClients/MtApi5TestClient/MainWindow.xaml.cs b/TestClients/MtApi5TestClient/MainWindow.xaml.cs
index 88f37934..2239a3f9 100755
--- a/TestClients/MtApi5TestClient/MainWindow.xaml.cs
+++ b/TestClients/MtApi5TestClient/MainWindow.xaml.cs
@@ -1,37 +1,32 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
+using System.Text.RegularExpressions;
using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
namespace MtApi5TestClient
{
///
/// Interaction logic for MainWindow.xaml
///
- public partial class MainWindow : Window
+ public partial class MainWindow
{
- ViewModel _vm { get; set; }
+ private ViewModel Vm { get; }
public MainWindow()
{
InitializeComponent();
- _vm = new ViewModel();
- _MainLayout.DataContext = _vm;
+ Vm = new ViewModel();
+ _MainLayout.DataContext = Vm;
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
- _vm.Close();
+ Vm.Close();
+ }
+
+ private void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
+ {
+ var regex = new Regex("[^0-9]+");
+ e.Handled = regex.IsMatch(e.Text);
}
}
}
diff --git a/TestClients/MtApi5TestClient/TimeSeriesValueViewModel.cs b/TestClients/MtApi5TestClient/TimeSeriesValueViewModel.cs
index 619f1e4b..6b549da4 100644
--- a/TestClients/MtApi5TestClient/TimeSeriesValueViewModel.cs
+++ b/TestClients/MtApi5TestClient/TimeSeriesValueViewModel.cs
@@ -1,21 +1,17 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MtApi5;
+using MtApi5;
using System.ComponentModel;
namespace MtApi5TestClient
{
public class TimeSeriesValueViewModel : INotifyPropertyChanged
{
- private string _SymbolValue;
+ private string _symbolValue;
public string SymbolValue
{
- get { return _SymbolValue; }
+ get { return _symbolValue; }
set
{
- _SymbolValue = value;
+ _symbolValue = value;
OnPropertyChanged("SymbolValue");
}
}
@@ -24,13 +20,36 @@ namespace MtApi5TestClient
public int StartPos { get; set; }
public int Count { get; set; }
+
+ private int _indicatorHandle;
+ public int IndicatorHandle
+ {
+ get { return _indicatorHandle; }
+ set
+ {
+ _indicatorHandle = value;
+ OnPropertyChanged("IndicatorHandle");
+ }
+ }
+
+ private ENUM_INDICATOR _indicatorType = ENUM_INDICATOR.IND_MACD;
+ public ENUM_INDICATOR IndicatorType
+ {
+ get { return _indicatorType; }
+ set
+ {
+ _indicatorType = value;
+ OnPropertyChanged("IndicatorType");
+ }
+ }
+
#region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
- PropertyChangedEventHandler handler = PropertyChanged;
- if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
+ var handler = PropertyChanged;
+ handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
diff --git a/TestClients/MtApi5TestClient/ViewModel.cs b/TestClients/MtApi5TestClient/ViewModel.cs
index 72f4ce17..d54b610f 100755
--- a/TestClients/MtApi5TestClient/ViewModel.cs
+++ b/TestClients/MtApi5TestClient/ViewModel.cs
@@ -7,7 +7,6 @@ using MtApi5;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Threading.Tasks;
-using System.Windows.Documents;
namespace MtApi5TestClient
{
@@ -568,12 +567,17 @@ namespace MtApi5TestClient
new MqlParam
{
DataType = ENUM_DATATYPE.TYPE_INT,
- IntegerValue = 0
+ IntegerValue = 12
},
new MqlParam
{
DataType = ENUM_DATATYPE.TYPE_INT,
- IntegerValue = 21
+ IntegerValue = 26
+ },
+ new MqlParam
+ {
+ DataType = ENUM_DATATYPE.TYPE_INT,
+ IntegerValue = 9
},
new MqlParam
{
@@ -584,17 +588,18 @@ namespace MtApi5TestClient
const string symbol = "EURUSD";
const ENUM_TIMEFRAMES timeframe = ENUM_TIMEFRAMES.PERIOD_H1;
- const ENUM_INDICATOR indicatorType = ENUM_INDICATOR.IND_MA;
+ const ENUM_INDICATOR indicatorType = ENUM_INDICATOR.IND_MACD;
var retVal = await Execute(() => _mtApiClient.IndicatorCreate(symbol, timeframe, indicatorType, parameters));
+ TimeSeriesValues.IndicatorHandle = retVal;
AddLog($"IndicatorCreate [IND_MA]: result - {retVal}");
}
private async void ExecuteIndicatorRelease(object o)
{
- const int indicatorHandle = 111;
+ var indicatorHandle = TimeSeriesValues.IndicatorHandle;
var retVal = await Execute(() => _mtApiClient.IndicatorRelease(indicatorHandle));
- AddLog($"IndicatorRelease: result - {retVal}");
+ AddLog($"IndicatorRelease [{indicatorHandle}]: result - {retVal}");
}
private async void ExecuteCopyRates(object o)
diff --git a/mq5/MtApi5.ex5 b/mq5/MtApi5.ex5
index 40e3e067..a0dc0006 100755
Binary files a/mq5/MtApi5.ex5 and b/mq5/MtApi5.ex5 differ
diff --git a/mq5/MtApi5.mq5 b/mq5/MtApi5.mq5
index 05ff3b81..4dbf5d4e 100755
--- a/mq5/MtApi5.mq5
+++ b/mq5/MtApi5.mq5
@@ -39,7 +39,7 @@
bool getBooleanValue(int expertHandle, int paramIndex, bool& res, string& err);
#import
-#define __DEBUG_LOG__
+//#define __DEBUG_LOG__
input int Port = 8228;