Help needed!

 

Hello,

I need help with a programming concept for a EA. This is the scenario:

I have 2 entry or pending orders in a sell limit and a buy stop 2 pips above that sell limit. The sell limit has a take profit of 20pips and the buy stop has a take profit of 10pips.

Let’s say the sell limit and buy stop both are live trades now. Now the buy stop hits its take profit and the rate is moving back down. Now the sell limit( or sell now that it is live) is positive 1 pip, I want the system to automatically replace that buy stop pending order that was their before. And if the sell limit hit its take profit I want the ea to replace that sell limit back where it was again. Can anyone offer any assistance with this?

Another thing is that if the buy stop doesn’t hit its take profit I don’t want it to enter a second entry order because the sell limit is 1 pip in the profit. Only if the buy stop is not there should it replace it.

Any help or suggestion will be greatly appreciated.

Reason: