Download MetaTrader 5
To add comments, please log in or register
Do you want to write a technical indicator? Find solution in MQL5 Reference!
user30456
37
user30456 2013.02.27 02:59 

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 ? 

phi nuts
2185
phi nuts 2013.02.27 06:04  
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

 

user30456
37
user30456 2013.02.27 08:15  
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() ?
phi nuts
2185
phi nuts 2013.02.27 08:50  
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 ?
user30456
37
user30456 2013.02.27 09:21  
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
/
To add comments, please log in or register