|
|
@@ -288,6 +288,24 @@ void execute_functionality_on_new_message(int i)
|
|
|
|
|
|
if(ticket != -1)
|
|
|
{
|
|
|
+ if(StringFind(message,"set") != -1 && StringFind(message,"stop") != -1 && StringFind(message,"loss") != -1 && StringFind(message,"entry") != -1)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(OrderSelect(ticket,SELECT_BY_TICKET))
|
|
|
+ {
|
|
|
+
|
|
|
+ bool result = OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,clrNONE);
|
|
|
+
|
|
|
+ if(result)
|
|
|
+ {
|
|
|
+ Print("Order Sl Modify to Open Price ", ticket);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Print("Error in Modify order SL : ", GetLastError()," Setting SL at: ",OrderOpenPrice()," price: ",OrderClosePrice());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if(StringFind(message,"take") != -1 && StringFind(message,"some") != -1 && StringFind(message,"partial") != -1 && StringFind(message,"profit") != -1)
|
|
|
{
|
|
|
@@ -297,7 +315,7 @@ void execute_functionality_on_new_message(int i)
|
|
|
|
|
|
double lot = NormalizeDouble(OrderLots()*(partialClose/100),2);
|
|
|
|
|
|
- bool result = OrderClose(ticket,lot,OrderOpenPrice(),10, clrNONE);
|
|
|
+ bool result = OrderClose(ticket,lot,OrderClosePrice(),10, clrNONE);
|
|
|
|
|
|
if(result)
|
|
|
{
|
|
|
@@ -331,24 +349,6 @@ void execute_functionality_on_new_message(int i)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(StringFind(message,"set") != -1 && StringFind(message,"stop") != -1 && StringFind(message,"loss") != -1 && StringFind(message,"entry") != -1)
|
|
|
- {
|
|
|
-
|
|
|
- if(OrderSelect(ticket,SELECT_BY_TICKET))
|
|
|
- {
|
|
|
-
|
|
|
- bool result = OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,clrNONE);
|
|
|
-
|
|
|
- if(result)
|
|
|
- {
|
|
|
- Print("Order Sl Modify to Open Price ", ticket);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Print("Error in Modify order SL : ", GetLastError());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|