Specification
This relatively simple EA will compliment a few other EAs that I’m running on the same account in different terminals. Therefore the rules this EA creates for trades must only apply to trades created by the EA.
It’s simple but hard to explain so please take a look at the example.
I need the EA to place an initial order and pending orders with set separation from the initially placed order. Orders will only use TP, no SL. When the initially placed order reaches TP the order gets repeated but at current level and all pending orders are changed to have the same separation as the first round of orders had.
Example:
First order is placed according to EA settings at price 5 with TP +1 pips (this will put TP at 6), second order (buy stop) at -1 pip from first order (this will put the second buy stop at 4) with TP +1 pips (price of TP is 5) and third order (buy stop) at -2 from second order (this will put the third buy stop at 2) with TP +2 pips (this will put price of that TP at 4).
Scenario 1.
First order is placed according to EA settings. First order reaches TP at 6 the following should be done:
New first order created and placed at 6 with the same settings as initial first order which is TP +1 pips (this will put TP at 7) and second order (buy stop) at -1 pips from initial newly created first order (this will put buy stop at 5) with TP +1 pips (this will put price of TP at 6) and third order (buy stop) at -2 from newly created second order (this will put buy stop at 3) with TP +2 pips (this will put price of TP at 5).
Scenario 2.
First order is placed according to EA settings at price 5 with TP +1 pips (price of TP is 6). First order reaches price of 4 and triggers second order and the following should be done:
Nothing by the EA. First order and second order are now active.
Price then drops to 2 and the following should be done:
Nothing by the EA. First order, second order and third order are now active.
EA settings interface (example):
First order placing
Symbol: EUR/USD
Order type: Buy stop
Order size: 1.00
Execution price: 5
TP: 1 pip
Second pending order placing
Order size: 1.00
Execution price relative to first order: -1 pip
TP: 1 pip
Third pending order placing
Order size: 1.00
Execution price relative to second order: -2 pip
TP: 2 pips
4th pending order placing …
5th….