pending orders need lite help !!!!!!!!

 

hello friends 

i have a question  about pending order:

 i have 2 pending orders  buy and sell once one of them hit i what to close the other  .

 i am  just a newbe mql programer  and its beyond my ability right now.

 

any direction friends????

 

 

many thanks. 

 
er007:

hello friends 

i have a question  about pending order:

 i have 2 pending orders  buy and sell once one of them hit i what to close the other  .

 i am  just a newbe mql programer  and its beyond my ability right now.

To be no longer a "newbie" you have to try,  and practice,  and fail,  and try again and learn.

Create a loop and loop through the open orders,  when you have just one pending order,  determine this by checking OrderType(),  you can OrderDelete() the remaining pending order. 

 
RaptorUK:

To be no longer a "newbie" you have to try,  and practice,  and fail,  and try again and learn.

Create a loop and loop through the open orders,  when you have just one pending order,  determine this by checking OrderType(),  you can OrderDelete() the remaining pending order. 

thanks  a lot RaptorUK

 

i will try to work on your description  .

 

thanks 

 
WhooDoo22:

Hello er007,

OrderCloseBy() function.

Oops, how did that get there? Hahaha!

Thank you



WHooDoo22

thanks a lot , 

i just  write :

 if()

 OrderCloseBy(order_id,opposite_id);(white out specific  id number ??)

return (0); 

 thanks

 
er007:


WHooDoo22

thanks a lot , 

i just  write :

 if()

 OrderCloseBy(order_id,opposite_id);(white out specific  id number ??)

return (0); 

You don't close pending orders, they aren't "open" . . .  you Delete them.
 
er007:


WHooDoo22

thanks a lot , 

i just  write :

 if()

 OrderCloseBy(order_id,opposite_id);(white out specific  id number ??)

return (0); 

 thanks

 

When posting code:

Please use this to post code . . . it makes it easier to read.

 

 
er007:


WHooDoo22

thanks a lot , 

i just  write :

 if()

 OrderCloseBy(order_id,opposite_id);(white out specific  id number ??)

return (0); 

 thanks

 

Actually I am not sure it would work in the case of pending orders BUT ;) it should because pending orders should be considered open orders, their just not sent yet. Give it a shot pro ;)

Also, your MetaEditor dictionary comes in handy sometimes. It'l treat ya' right. Hahaha! ;)

MetaEditor Dictionary

Thank you

 
WhooDoo22:

Actually I am not sure it would work in the case of pending orders BUT ;) it should because pending orders should be considered open orders, their just not sent yet. Give it a shot pro ;)

Also, your MetaEditor dictionary comes in handy sometimes. It'l treat ya' right. Hahaha! ;)

Thank you


i will, thank you (-;
 
RaptorUK:
You don't close pending orders, they aren't "open" . . .  you Delete them.

Simon,

I just placed a pending order in the market and noticed what you meant by NOT "open". The only options allowed by my MT4 terminal is to modify or delete the pending order. The option to close the order is not available (because it is not "open", its "pending"). Ah-ha! ;) Hahaha!

Hold on... Here comes the OrderDelete() function :)

er007,

Apologies for suggesting OrderCloseBy() function. I believe a more sensible ;) solution is to use a cycle to locate the position of the pending order to close, select the order's ticket number AND ;) then use the OrderDelete() function to close the desired pending order. Whew, wipin' sweat off my brow for that one. ;)

Thank you

 
WhooDoo22:

Simon,

I just placed a pending order in the market and noticed what you meant by NOT "open". The only options allowed by my MT4 terminal is to modify or delete the pending order. The option to close the order is not available (because it is not "open", its "pending"). Ah-ha! ;) Hahaha!

Hold on... Here comes the OrderDelete() function :)

er007,

Apologies for suggesting OrderCloseBy() function. I believe a more sensible ;) solution is to use a cycle to locate the position of the pending order to close, select the order's ticket number AND ;) then use the OrderDelete() function to close the desired pending order. Whew, wipin' sweat off my brow for that one. ;)

Thank you


hi  WhooDoo  its ok ,thank you for your help. :-)

have a nice  weekend .

 

er007,

I don't even keep up with days of the week, holidays, anything. I just code and slave away ;) Hahaha!

Glad to be of service.

Reason: