Modify My EA

Job ID: 36747966

Budget: $10 – $30 USD

There are 6 steps of EA working:
1- Two pending orders are opened
2- When 1 order is executed, second pending order is deleted.
3- Price line of opened order is now our base line. For example order was opened at 0.12354. That is our base line.

(Upper zone of this base line is green zone, Lower zone is called red zone)

4- Whenever market/price action enters red zone,(from up to down) Sell order is opened at same price of 0.12354 or
Whenever market/price action enters green zone,(from down to up) Buy order is opened at same price of 0.12354.
(No buy order in red zone and no sell order in green zone)

5- Two opened orders with same sum and same lot are deleted.
6- Total profit closes all trades or total loss closes all trades.

All stages are working good but stage 4 is not.
At step 4 Ea need to open trade every time,as per zone.
(No buy order in red zone and no sell order in green zone)