diff --git a/MTApiService/Properties/AssemblyInfo.cs b/MTApiService/Properties/AssemblyInfo.cs
index ef1be156..c7504023 100755
--- a/MTApiService/Properties/AssemblyInfo.cs
+++ b/MTApiService/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.14.0")]
-[assembly: AssemblyFileVersion("1.0.14.0")]
+[assembly: AssemblyVersion("1.0.15.0")]
+[assembly: AssemblyFileVersion("1.0.15.0")]
diff --git a/MTConnector/MTConnector.cpp b/MTConnector/MTConnector.cpp
index 290f98cf..34f85ab1 100755
--- a/MTConnector/MTConnector.cpp
+++ b/MTConnector/MTConnector.cpp
@@ -4,6 +4,7 @@
#include "MT4Handler.h"
#include "Windows.h"
+#include < vcclr.h >
using namespace System;
using namespace MTApiService;
diff --git a/MTConnector/MTConnector.vcxproj b/MTConnector/MTConnector.vcxproj
index 8e2f78da..d4dffeb1 100755
--- a/MTConnector/MTConnector.vcxproj
+++ b/MTConnector/MTConnector.vcxproj
@@ -113,7 +113,7 @@
true
- user32.lib;%(AdditionalDependencies)
+ %(AdditionalDependencies)
.\MTConnector.def
diff --git a/MtApi/MtApiClient.cs b/MtApi/MtApiClient.cs
index 7272a15e..7a69bb9e 100755
--- a/MtApi/MtApiClient.cs
+++ b/MtApi/MtApiClient.cs
@@ -303,6 +303,10 @@ namespace MtApi
return (TradeOperation) retVal;
}
+ public bool OrderCloseAll()
+ {
+ return sendCommand(MtCommandType.OrderCloseAll, null);
+ }
#endregion
#region Check Status
diff --git a/MtApi/MtCommandType.cs b/MtApi/MtCommandType.cs
index 637d4a3d..bbd09c59 100755
--- a/MtApi/MtCommandType.cs
+++ b/MtApi/MtCommandType.cs
@@ -181,6 +181,7 @@ namespace MtApi
iTimeArray = 149,
//
- RefreshRates = 150
+ RefreshRates = 150,
+ OrderCloseAll = 151
}
}
diff --git a/MtApi/Properties/AssemblyInfo.cs b/MtApi/Properties/AssemblyInfo.cs
index cf21432a..13c44a3c 100755
--- a/MtApi/Properties/AssemblyInfo.cs
+++ b/MtApi/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.16.0")]
-[assembly: AssemblyFileVersion("1.0.16.0")]
+[assembly: AssemblyVersion("1.0.17.0")]
+[assembly: AssemblyFileVersion("1.0.17.0")]
diff --git a/MtApiInstaller/Product.wxs b/MtApiInstaller/Product.wxs
index 19a48ac4..a2e70073 100755
--- a/MtApiInstaller/Product.wxs
+++ b/MtApiInstaller/Product.wxs
@@ -1,7 +1,7 @@
-
+
= 0; i--)
+ {
+ if (OrderSelect(i, SELECT_BY_POS))
+ {
+ int type = OrderType();
+
+ switch(type)
+ {
+ //Close opened long positions
+ case OP_BUY: OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
+ break;
+ //Close opened short positions
+ case OP_SELL: OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );
+ break;
+ }
+ }
+ }
+
+ return (true);
}
\ No newline at end of file