Array out of range error on grid
-
Hello,
I'm trying to make an EA that will basically open a position with every time the market moves "n" pips. Let's say 10. 10 pip stoploss. If market moves 10 pips the EA will move the previous order to BE and open a new position in that direction with a 10 pip s/l. So only one position will be open with a 10 pip risk at a time. All other positions would be at BE until market conditions take them out.My problems are probably many but the immediate one is I'm getting an out of array on the "open price" which I'm trying to call up to establish my 10 pip move.
Here's the link: https://fxdreema.com/shared/Ea7prYTPb
I appreciate any help with the error or changes to accomplish my goal.
-
The problem is that you are combining two loops one after the other, the 'for each trade' and the BE block. That is why the error arises. You should substitute the BE block for another pink block (modify stops) to move the SL to BE instead.