It may work now, but it may stop working under some specific circumstances or when MT4 gets its next update, or it may work well forever - you'll never know.
The next part has an error. You use the "ii" variable to cycle through the orders, but then you select an order number "i". If you have only one order or if the only order you need deleted happens to be the same as the value stored in the variable "i", it will work. In other cases it will fail:
So I tested out this new version of the ea, and it works well, but what I don't understand is is that if I put the ea on two different charts of the same currency pair, then the ea will only open position for the first chart not the second.
Can you help me out on this, why can't the ea open trades on multiple charts of the same currency pair?
P.S.: Except for the GBP/JPY, for that currency pair, the ea opens positions for multiple charts
the ea closes out the pending orders as soon as any of them gets gets filled. It works only if the ea is attached to only one chart, if it is attached to two charts of the same currency pairs, the pending orders on the second chart will just disappear if any of the pending orders gets filled.
So, I have been analyzing the market and and I think I know what function is missing from Amazing ea.
I believe that everything is fine with this ea except one thing: MARKET REVERSALS. The ea should anticipate market conditions in which the market reverses.
So I was thinking to add two of these functions (DOUBLE REVERSAL) So, we could have two reversal orders reversal 1 and reversal 2. Both of these should have a stop loss and take profit.
SO as an example: if points away is set to 25 pips, once we get BUY order (the market moves 25 pips up) the market moves a little bit, but not good enough to reach our TP (let's say 75 pips) so it REVERSES. Now, our stop loss is hit and we lost 25 pips. Now ea places a SELL order, moves a little bit but unfortunately the market reverses again (DOUBLE REVERSAL), so now the ea places the opposite of our previous order, so now it places a BUY order, the market finally moves in one direction good enough to hit our TP.
So, there should be two functions which we should be able to turn true/false, and they should both have TP/SL in order to make them work.
Let me know what you think, and also if you would be interested in coding this function.
So, instead of trying to trade only once, it will try to trade 3 times? What happens if OCO = false and double reversal is set to true? Won't these reversal orders interfere with the opposite pending order? BTW, the reversal trades should be market orders, not pending ones, right?
Right, so it will try to order three times but only if the stop losses are hit, just like in the above example. If OCO is false then this strategy won't work. So OCO must always be true. And Yes, the reversal orders should be market orders.