Switching auto trading state problem with Expert Advisor

To add comments, please log in or register
nowayfra
29
nowayfra  
Hello guys, I need some help getting my EA to work properly. The thing is, he can modify positions, but only if I assign the EA to my symbol chart with autotrading ALREADY ENABLED. If I assign the EA to the chart while autotrading is disabled (disabled via the button) and attempt to modify position I get "cannot modify position due to autotrading disabled". If I enable autotrading later on, calls like CTrade.PositionModify() only responds with "CTrade::OrderSend: ... [auto trading disabled by client]". I also made sure that auto trading is allowed in Options/Experts tab. So what am I missing here? Thanks in advance!
Guufuj Forex
132
Guufuj Forex  
nowayfra:
Hello guys, I need some help getting my EA to work properly. The thing is, he can modify positions, but only if I assign the EA to my symbol chart with autotrading ALREADY ENABLED. If I assign the EA to the chart while autotrading is disabled (disabled via the button) and attempt to modify position I get "cannot modify position due to autotrading disabled". If I enable autotrading later on, calls like CTrade.PositionModify() only responds with "CTrade::OrderSend: ... [auto trading disabled by client]". I also made sure that auto trading is allowed in Options/Experts tab. So what am I missing here? Thanks in advance!
Long story, try to make it short
nowayfra
29
nowayfra  
Short:

if button auto trading enabled -> EA start -> CTrade may modify positions -> OK

if button auto trading disabled -> EA start -> button auto trading enabled -> CTrade may NOT modify positions -> NOT OK

Any ideas why?
To add comments, please log in or register