Forum

For loop not working

This seems like a small problem and maybe it is but I've been struggling with it for a while and have finally given it. My ea opens 2 orders on buy and sell signals . First OrderBuy1 with sl and tp, the OrderBuy2 with only sl. OrderBuy 1 can close with tp and sl but OrderBuy 2 is supposed to be

Error 134 when there is more than enough funds

I have a basic Expert Advisor that uses: ATR for setting SL and TP ( ATR*1.5) 2-5% risk atrPip converts the atr to pips and rounds up. I use the atrPip to calculate the perPip value for my risk and calculate the lot size I need to trade I am testing with a $1000 account in a micro account. However I