What is wrong with my code? - page 2

 
n8937g:

Your Indicator is repainting... try this one. I think your opening offset now could be because of this...earlier tests showed an offset because you still had open order(s) and/or two indicators to prove up. Have you added Trailing stop or Take profit to your code yet? Letting it go back to the point at which the opposite orders were placed before closing left a lot of profit on the table instead of in the pocket too LOL...What pair and TF are you testing?


Hi n,

I think I know what the problem is. I used your indicator, and still had the same problem. So I made an indicator that draw arrows(up and down) for every time the logic in my EA trigger the orders, but didn't issue any order at all. With this arrows indicator, no problem whatsoever, but as soon as I add the OrderSend, and the other functions, the problem came back. I think the problem is with my historical data that seems to be corrupted. BTW, your indicator works much better than mine that as you said has the offset problem that send the wrong orders.

Thank You,

FAC in Florida.

Reason: