How to detect if I have open orders ?

 
Hello,

Following the indicators, I would like to open one order at a time.

So before open an order, I would like EA detect if there is an open order yet.

Second, it must detect the type of the order (BUY or SELL order).

Process will be:

1. EA detect if there is open order yet, if none, it open order following the indicator signal (BUY or SELL), BUY in the example.
2. Indicator send another signal to SELL
3. EA detect if there is an open order BUY, it close the open order and open a new SELL order.

Thank you.
 

nazoreen:

in the code section check the EA DoubleUp with a twist this does the same thing as you want to do it counts how many orders where opend and checks if they where buys or sells, and only lets one order at a time.

Hope this helps

Hazem