opening only one order

 
hi... is there any way to open only one order in OnTick() function without using OrdersTotal () OR ExpertRemove()?
 
Yes you have to count the amount of orders for the chart symbol use the search function.
 
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:
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
 

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(..