opening only one order

To add comments, please log in or register
saman89200
19
saman89200  
hi... is there any way to open only one order in OnTick() function without using OrdersTotal () OR ExpertRemove()?
Marco vd Heijden
Moderator
12666
Marco vd Heijden  
Yes you have to count the amount of orders for the chart symbol use the search function.
saman89200
19
saman89200  
Marco vd Heijden:
Yes you have to count the amount of orders for the chart symbol use the search function.
hi marco thank you for the reply i just want to open one order if i do that if the order reaches its stop or tp the same order will be opened again .... for example if you open an order in Onint() function the order will be opened only once regardless of it hitiing sl or tp it wont open again...i want to do the same thing in OnTick()
saman89200
19
saman89200  
saman89200:
hi marco thank you for the reply i just want to open one order if i do that if the order reaches its stop or tp the same order will be opened again .... for example if you open an order in Onint() function the order will be opened only once regardless of it hitiing sl or tp it wont open again...i want to do the same thing in OnTick()
because i want to use trailing stop on that order and i cant use trailing stop in Oninit so it has to be in Ontick
Marco vd Heijden
Moderator
12666
Marco vd Heijden  

Those are two separate things.

One order only and trailingstop.

You can set a boolean flag upon opening the order and reset it through the returnvalue of OrderClose(..

To add comments, please log in or register