OrderSend and OrderModify

 

I'm using an InterBank FX demo account and I can't execute an ordersend command when setting the stop and limit. I have verified that the stop and limit values were correct. Also, I have to confirm the ordermodify command. Am I doing something wrong? I want to automate my trading strategy.


Thanks in advance.

 

could be u supposed to send the TP & ST Separately from the order (OrderSend() without TP & SL) & then use OrderModify() 4 the TP & SL

 

Do you know this for sure?

How do I set the stop and limit without confirming it? I have unchecked the manual confirmation box.

 
kerbed87908:

Do you know this for sure?

You can verify this. Press 'New Order' and check which one of these show in the 'Type' pull-down menu:

  • "Instant Execution" - order can be placed with stops.
  • "Market Execution" - order must be placed with stops = 0.
 
gordon:

You can verify this. Press 'New Order' and check which one of these show in the 'Type' pull-down menu:

  • "Instant Execution" - order can be placed with stops.
  • "Market Execution" - order must be placed with stops = 0.


Ok. It says market execution. Good, I can deal with that. Thank you!!

How do I modify the order without having the confirmation box pop-up?

 

for example:

double Lots = 0.1;
int SL = 500;
int TP = 1000;
int Magic = 12345;

int ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, 0, 0, "", Magic, 0, Red);
if (ticket == -1)
   {
   Print("OrderSend() error - ", GetLastError());
   }
if (ticket > -1)
   {
   OrderSelect(ticket, SELECT_BY_TICKET);
   bool retrn = OrderModify(OrderTicket(), OrderOpenPrice(), Bid + SL*Point, Bid - TP*Point, 0, Red);
   if (retrn == false)
      {
      Print("OrderModify() error - ", GetLastError());
      }
   }
 
Thank you very much!! It worked.