1. to define a range by two variables A and B in the general variables of the EA, for example 30 pips above and below the current price (the whole range is 60 pips).
2. divide this range in three zones C, D and E , where C is in the bottom of the range and D in the meddle and E in the top of the range.
3. In the Bottom zone C the EA should put number of Pending Buy Orders equal to variable Nbuy equal for example to 5, and the zone C should be divided equally for the Buy Orders. the orders 1, 2, 3, 4, and 5 from top to bottom of the zone. The lot size of each order equal to 1% of the account.
4. The Stop-Loss of these Pending Buy Orders should be equal to variable Bstop, for example 10 pips.
5. In the Top zone E the EA should put number of Pending Sell Orders equal to variable Nsell equal for example to 5, and the zone E should be divided equally for the Buy Orders. the orders 1, 2, 3, 4, and 5 from bottom to top of the zone. The lot size of each order equal to 1% of the account.
6. The Stop-Loss of these Pending Sell Orders should be equal to variable Sstop, for example 10 pips.
7. In the meddle zone D, no orders are put.
8. the Take-Profit of the Pending Buy Orders should equal to:
a. Take-Profit of Pending Buy Order 1 when hit the Pending Sell Order 1
b. Take-Profit of Pending Buy Order 2 when hit the Pending Sell Order 2
c. Take-Profit of Pending Buy Order 3 when hit the Pending Sell Order 3
d. Take-Profit of Pending Buy Order 4 when hit the Pending Sell Order 4
e. Take-Profit of Pending Buy Order 5 when hit the Pending Sell Order 5
9. the Take-Profit of the Pending Sell Orders should equal to:
a. Take-Profit of Pending Sell Order 1 when hit the Pending Buy Order 1
b. Take-Profit of Pending Sell Order 2 when hit the Pending Buy Order 2
c. Take-Profit of Pending Sell Order 3 when hit the Pending Buy Order 3
d. Take-Profit of Pending Sell Order 4 when hit the Pending Buy Order 4
e. Take-Profit of Pending Sell Order 5 when hit the Pending Buy Order 5
10. After the zone Sstop the EA should repeat the same previous procedure but in the opposite, where the bottom zone should have Pending Buy Orders.
11. After the zone Bstop the EA should repeat the same previous procedure but in the opposite, where the top zone should have Pending Sell Orders.