|
|
@@ -288,6 +288,24 @@ void execute_functionality_on_new_message(int i)
|
|
288
|
288
|
|
|
289
|
289
|
if(ticket != -1)
|
|
290
|
290
|
{
|
|
|
291
|
+ if(StringFind(message,"set") != -1 && StringFind(message,"stop") != -1 && StringFind(message,"loss") != -1 && StringFind(message,"entry") != -1)
|
|
|
292
|
+ {
|
|
|
293
|
+
|
|
|
294
|
+ if(OrderSelect(ticket,SELECT_BY_TICKET))
|
|
|
295
|
+ {
|
|
|
296
|
+
|
|
|
297
|
+ bool result = OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,clrNONE);
|
|
|
298
|
+
|
|
|
299
|
+ if(result)
|
|
|
300
|
+ {
|
|
|
301
|
+ Print("Order Sl Modify to Open Price ", ticket);
|
|
|
302
|
+ }
|
|
|
303
|
+ else
|
|
|
304
|
+ {
|
|
|
305
|
+ Print("Error in Modify order SL : ", GetLastError()," Setting SL at: ",OrderOpenPrice()," price: ",OrderClosePrice());
|
|
|
306
|
+ }
|
|
|
307
|
+ }
|
|
|
308
|
+ }
|
|
291
|
309
|
|
|
292
|
310
|
if(StringFind(message,"take") != -1 && StringFind(message,"some") != -1 && StringFind(message,"partial") != -1 && StringFind(message,"profit") != -1)
|
|
293
|
311
|
{
|
|
|
@@ -297,7 +315,7 @@ void execute_functionality_on_new_message(int i)
|
|
297
|
315
|
|
|
298
|
316
|
double lot = NormalizeDouble(OrderLots()*(partialClose/100),2);
|
|
299
|
317
|
|
|
300
|
|
- bool result = OrderClose(ticket,lot,OrderOpenPrice(),10, clrNONE);
|
|
|
318
|
+ bool result = OrderClose(ticket,lot,OrderClosePrice(),10, clrNONE);
|
|
301
|
319
|
|
|
302
|
320
|
if(result)
|
|
303
|
321
|
{
|
|
|
@@ -331,24 +349,6 @@ void execute_functionality_on_new_message(int i)
|
|
331
|
349
|
}
|
|
332
|
350
|
}
|
|
333
|
351
|
|
|
334
|
|
- if(StringFind(message,"set") != -1 && StringFind(message,"stop") != -1 && StringFind(message,"loss") != -1 && StringFind(message,"entry") != -1)
|
|
335
|
|
- {
|
|
336
|
|
-
|
|
337
|
|
- if(OrderSelect(ticket,SELECT_BY_TICKET))
|
|
338
|
|
- {
|
|
339
|
|
-
|
|
340
|
|
- bool result = OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,clrNONE);
|
|
341
|
|
-
|
|
342
|
|
- if(result)
|
|
343
|
|
- {
|
|
344
|
|
- Print("Order Sl Modify to Open Price ", ticket);
|
|
345
|
|
- }
|
|
346
|
|
- else
|
|
347
|
|
- {
|
|
348
|
|
- Print("Error in Modify order SL : ", GetLastError());
|
|
349
|
|
- }
|
|
350
|
|
- }
|
|
351
|
|
- }
|
|
352
|
352
|
}
|
|
353
|
353
|
|
|
354
|
354
|
|