BUY Stop and Sell Stop, Delete pending order.

 

Good day.

The code that i have posted below returns 4109 error and i dont know where to look for the error and it is my first time writing a code for pending orders and how do i delete a certain pending order given that every news times a certain symbol will have a pending trade (BUYSTOP and SELLSTOP) 5 minutes before the news then if one of them is activated, the other pending will be deleted...

         ticket=OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask+PendingPoint(),0,0,0,"",0,0,CLR_NONE);
         if(ticket>0)
         {
            status="Pending Order placed BUY STOP with ticket #"+ticket;   
         }

Thank you very much

 
raven_chrono:

Good day.

The code that i have posted below returns 4109 error and i dont know where to look for the error and it is my first time writing a code for pending orders and how do i delete a certain pending order given that every news times a certain symbol will have a pending trade (BUYSTOP and SELLSTOP) 5 minutes before the news then if one of them is activated, the other pending will be deleted...

Thank you very much

Why aren't you checking the return value and printing the error and any relevant variables ? What are Function return values ? How do I use them ?

Did you allow live trading ? do you have a smiley face in the top right corner of the chart ?


 
raven_chrono:

Good day.

The code that i have posted below returns 4109 error and i dont know where to look for the error........

stderror

open your metaeditor and choose inside navigator 'include' ==> 'stderror.mqh' and you can check

what error 4109 means

 
RaptorUK:

Why aren't you checking the return value and printing the error and any relevant variables ? What are Function return values ? How do I use them ?

Did you allow live trading ? do you have a smiley face in the top right corner of the chart ?



i already enable allow live trading, allow dll imports and activated EA.

i have also figure out the error and it works now but the only question remains is that on how you will know if a certain pending order is activated...

 
raven_chrono:


i already enable allow live trading, allow dll imports and activated EA.

i have also figure out the error and it works now but the only question remains is that on how you will know if a certain pending order is activated...

It's no longer pending . . . it's either an OP_BUY or OP_SELL check it's OrderType()
 
RaptorUK:
It's no longer pending . . . it's either an OP_BUY or OP_SELL check it's OrderType()


thank you very much
Reason: