SL & TP

 

Hi, one question,

is it possible to delete a TP or SL once added by script?

I have also a custom function of OrderModify...but with parameters 0,0 it doesn't seem to work

 
florenceale:

Hi, one question,

is it possible to delete a TP or SL once added by script?

I have also a custom function of OrderModify...but with parameters 0,0 it doesn't seem to work

  1. You asked two questions.

  2. Right click on the order and modify, right click on the TP/SL and select cancel (top line.)
 

yes i know perfectly how to do that  with the program, but i want to know if I can do by script.

When i already have SL and TP, want to know if with something like this...


OrderModify(ord_a,Bid,0,0,0,0);


I can get back to have no SL and no TP...

but it "doesn't seem to work" in this way...

 
florenceale:

yes i know perfectly how to do that  with the program, but i want to know if I can do by script.

When i already have SL and TP, want to know if with something like this...

OrderModify(ord_a,Bid,0,0,0,0);

I can get back to have no SL and no TP...

but it "doesn't seem to work" in this way...

  1. A script is a program.
  2. You can't modify the open price of an opened order. Select the order (if not currently done) and use OrderOpenPrice()
  3. Check your return codes for errors and report them.
              What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
              Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

Reason: