Need code: open new trade if previous trade up +10 pips

 

hi

it should basically open a new trade if the previous trade (no matter if its a sell or a buy order) has reached 10 pips. it should not be a take profit thing, so from the point on where the first trade hits 10 pips there will be two trades open. if second trade reaches 10 pips aswell another trade should be opened etc...

summary: if last trade reaches 10 pips, open new trade in same direction

all trades will be closed simultaniously regardless how many are in profit or loss (if you have the code for this aswell, that would be much appreciated!)

why do i need this? i have an ea thats currently working on stochastic and macd with pretty odd settings which gives me the current trends direction. as these indicators arent build for such things, the ea produces 2/3 small bad trades but on the other hand it catches the bigger market movements and with the reqzested modifications it should be a pretty decent ea, at least for backtesting.

ps.: ive just registered, so in case im at the wrong place, please be so kind and give me the link to the proper forums :) thanks!

Reason: