error 4756

 

hello, i'm using the CTrade class and i use positionmodify() to have trailing stops 
however each time the expert advisor has to modify the position i get the 4756 error, here is a pic of the errors :

any ideas about what's causing this ? 

 
karemtalli:

hello, i'm using the CTrade class and i use positionmodify() to have trailing stops 
however each time the expert advisor has to modify the position i get the 4756 error, here is a pic of the errors :

any ideas about what's causing this ? 

Don't just check GetLastError(), but also check trade result, see the code in here and read the rest of the thread. You have invalid stop, which mean you probably modify within the range of SymbolInfoInteger's  SYMBOL_TRADE_STOP_LEVEL &/ SYMBOL_TRADE_FREEZE_LEVEL

 

 
ok thanks i figured the problem i was trying to change the stop values by very little differnce
any way do you know other ways to implement trailing stops other than this way, i mean is there an easier way or function (preferably in CTrade class) to do it automaticaly instead
of using  positionmodify() ?
 
karemtalli:
ok thanks i figured the problem i was trying to change the stop values by very little differnce
any way do you know other ways to implement trailing stops other than this way, i mean is there an easier way or function (preferably in CTrade class) to do it automaticaly instead
of using  positionmodify() ?
Nope, but you can create your own trade class, don't you ?
 
phi.nuts:
Nope, but you can create your own trade class, don't you ?
i'm not that good yet... hopefully i will in the future
Reason: