Plz Help Me How to Write EA with this strategy

 

Hi all,

How to write EA code with this condition :

Open Order:

1. when order#1 open is BUY i wanna put order#2 SELL stop with -50 with lots double

2. when order#2 executed i wanna put order#3BUY stop with same price with order#1


3. when order#3 executed i wanna put order#4SELL stop with same price with order#2 continue till maximumopentrade(variable external)



Close All Order :

when last order +150 pips with trailling stop 50 after +100



thx

Reason: