Hello,
I am wondering if someone can help me with a programing problem I am having with an EA.
Basically, I just don't know how to go about what I am wanting.
Here is the scoop.
At a certain time, the EA will open two pending orders (one buy, one sell) X pips away from current price.
What I want to have happen is as follows:
Let's call the orders ord1 and ord2 for now
Price moves and enters ord1
If price continues in my favor to ord1 hits TP
Delete ord2
If price moves against ord1 and hits ord2, both trades will remain open until either stopped or TP (ord2 will TP before ord1 S/L and vice versa to reduce losses)
Right now, if ord1 enters and goes to TP without ord2 entering, ord2 remains unless I delete it manually, or I can get ord2 to delete as soon as ord1 enters, but that defeats the purpose of the potential hedge if needed.
Basically, if a buy is entered, I want the coresponding pending sell to remain until the buy hits TP, then delete the pending sell.
Clear as mud??
Anyways, hopefully someone can help me out with coding this.
Thanks
I am wondering if someone can help me with a programing problem I am having with an EA.
Basically, I just don't know how to go about what I am wanting.
Here is the scoop.
At a certain time, the EA will open two pending orders (one buy, one sell) X pips away from current price.
What I want to have happen is as follows:
Let's call the orders ord1 and ord2 for now
Price moves and enters ord1
If price continues in my favor to ord1 hits TP
Delete ord2
If price moves against ord1 and hits ord2, both trades will remain open until either stopped or TP (ord2 will TP before ord1 S/L and vice versa to reduce losses)
Right now, if ord1 enters and goes to TP without ord2 entering, ord2 remains unless I delete it manually, or I can get ord2 to delete as soon as ord1 enters, but that defeats the purpose of the potential hedge if needed.
Basically, if a buy is entered, I want the coresponding pending sell to remain until the buy hits TP, then delete the pending sell.
Clear as mud??
Anyways, hopefully someone can help me out with coding this.
Thanks
Chris