Help please with breakeven and arrays - page 2

 
Viffer wrote >>
If you have 3 orders (0,1 & 2) and want to close 1 & 2. Running up when i=1, you close #1 and increment i =2. the array however changes the index values to 0 and 1 for the two orders that are left. you now try and select for i=2 which doesn't exist so the loop exits. you need to wait for the next tick to reset the loop to find and close the second order. That's my newly aquired understanding anyway.


You gots it now. BTW it took me months to figure this out personally, that was back in 2006 but just saying the learning curve is pretty similar for many of us, we are just at different points on the curve.

4yrs of MQL has taught me that the only thing I can be supremely confident in knowing is knowing that I don't know jack today compared to how much I'm prolly going to learn in the next 6 months...and in 6 months I'm going to say the same thing all over again.

 
Ahahaha!

I found why my EA wasn't working despite all the good advice :)

You probably already guessed, it was a totally newb error. I have my extern ints set up for T/P, S/L and BreakEven so I just type in a pip value. Then I multiply them by point. Except I wasn't doing so for BreakEven.
My backtesting never showed any breakeven trades because the BreakEven variable would have been 1000 times too large...

Thanks everyone for contributing. I just had that awesome feeling when so many hours of working on one problem finally came together.
Reason: