diff --git a/TestClients/MtApi5TestClient/MainWindow.xaml b/TestClients/MtApi5TestClient/MainWindow.xaml
index 7cb8099b..209b67d2 100755
--- a/TestClients/MtApi5TestClient/MainWindow.xaml
+++ b/TestClients/MtApi5TestClient/MainWindow.xaml
@@ -259,6 +259,7 @@
+
diff --git a/TestClients/MtApi5TestClient/ViewModel.cs b/TestClients/MtApi5TestClient/ViewModel.cs
index 420dff8b..1dba5641 100755
--- a/TestClients/MtApi5TestClient/ViewModel.cs
+++ b/TestClients/MtApi5TestClient/ViewModel.cs
@@ -16,6 +16,7 @@ namespace MtApi5TestClient
public DelegateCommand DisconnectCommand { get; private set; }
public DelegateCommand OrderSendCommand { get; private set; }
+ public DelegateCommand HistoryOrderGetIntegerCommand { get; private set; }
public DelegateCommand HistoryDealGetDoubleCommand { get; private set; }
public DelegateCommand HistoryDealGetIntegerCommand { get; private set; }
public DelegateCommand HistoryDealGetStringCommand { get; private set; }
@@ -196,6 +197,7 @@ namespace MtApi5TestClient
DisconnectCommand = new DelegateCommand(ExecuteDisconnect, CanExecuteDisconnect);
OrderSendCommand = new DelegateCommand(ExecuteOrderSend);
+ HistoryOrderGetIntegerCommand = new DelegateCommand(ExecuteHistoryOrderGetInteger);
HistoryDealGetDoubleCommand = new DelegateCommand(ExecuteHistoryDealGetDouble);
HistoryDealGetIntegerCommand = new DelegateCommand(ExecuteHistoryDealGetInteger);
HistoryDealGetStringCommand = new DelegateCommand(ExecuteHistoryDealGetString);
@@ -277,6 +279,16 @@ namespace MtApi5TestClient
AddLog(message);
}
+ private async void ExecuteHistoryOrderGetInteger(object o)
+ {
+ const ulong ticket = 12345;
+ const ENUM_ORDER_PROPERTY_INTEGER propertyId = ENUM_ORDER_PROPERTY_INTEGER.ORDER_POSITION_ID;
+
+ var retVal = await Execute(() => _mtApiClient.HistoryOrderGetInteger(ticket, propertyId));
+
+ AddLog($"HistoryOrderGetInteger: {retVal}");
+ }
+
private async void ExecuteHistoryDealGetDouble(object o)
{
const ulong ticket = 12345;
diff --git a/mq5/MtApi5.ex5 b/mq5/MtApi5.ex5
index b5791367..3547d3c3 100755
Binary files a/mq5/MtApi5.ex5 and b/mq5/MtApi5.ex5 differ
diff --git a/mq5/MtApi5.mq5 b/mq5/MtApi5.mq5
index f087577c..90d50a39 100755
--- a/mq5/MtApi5.mq5
+++ b/mq5/MtApi5.mq5
@@ -1,7 +1,7 @@
#property copyright "Vyacheslav Demidyuk"
#property link ""
-#property version "1.3"
+#property version "1.4"
#property description "MtApi (MT5) connection expert"
#include
@@ -39,6 +39,8 @@
bool getBooleanValue(int expertHandle, int paramIndex, bool& res, string& err);
#import
+//#define __DEBUG_LOG__
+
input int Port = 8228;
int ExpertHandle;
@@ -92,7 +94,9 @@ bool IsDemo()
bool IsTesting()
{
bool isTesting = MQLInfoInteger(MQL_TESTER);
+#ifdef __DEBUG_LOG__
PrintFormat("IsTesting: %s", isTesting ? "true" : "false");
+#endif
return isTesting;
}
@@ -141,7 +145,9 @@ int init()
return (1);
}
+#ifdef __DEBUG_LOG__
PrintFormat("Expert Handle = %d", ExpertHandle);
+#endif
//--- Backtesting mode
if (IsTesting())
@@ -219,10 +225,12 @@ int executeCommand()
return (0);
}
+#ifdef __DEBUG_LOG__
if (commandType > 0)
{
Print("executeCommand: commnad type = ", commandType);
}
+#endif
switch (commandType)
{
@@ -681,7 +689,9 @@ void Execute_Request()
string response = "";
if (request != "")
{
+#ifdef __DEBUG_LOG__
Print("Execute_Request: incoming request = ", request);
+#endif
response = OnRequest(request);
}
@@ -1151,7 +1161,7 @@ void Execute_HistoryOrderGetInteger()
return;
}
- if (!sendULongResponse(ExpertHandle, HistoryOrderGetInteger(ticket_number, (ENUM_ORDER_PROPERTY_INTEGER)property_id), _response_error))
+ if (!sendLongResponse(ExpertHandle, HistoryOrderGetInteger(ticket_number, (ENUM_ORDER_PROPERTY_INTEGER)property_id), _response_error))
{
PrintResponseError("HistoryOrderGetInteger", _response_error);
}