EA return "invalid stop" in live account.

 

hi,

i have a EA ,it function correctly  in back testing,without no error.

but it return error message in live account as below:

----------------------------------

PM 0 0406_EA_xxx (USDJPY,M15) 12:45:07 CTrade::OrderSend: modify USDJPY (sl: 99.389, tp: 97.871) [invalid stops]

ID 0 0406_EA_xxx (USDJPY,M15) 12:45:07 Error modifying position by USDJPY : 'Invalid stops'

QH 0 0406_EA_xxx (USDJPY,M15) 12:45:07 Modify parameters : SL=99.389000,TP=97.871000


----------------------------------- 

 and the open price is 98.0 

 

can somebody tell me why?   

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
 
xhxiang:

hi,

i have a EA ,it function correctly  in back testing,without no error.

but it return error message in live account as below:

----------------------------------

PM 0 0406_EA_xxx (USDJPY,M15) 12:45:07 CTrade::OrderSend: modify USDJPY (sl: 99.389, tp: 97.871) [invalid stops]

ID 0 0406_EA_xxx (USDJPY,M15) 12:45:07 Error modifying position by USDJPY : 'Invalid stops'

QH 0 0406_EA_xxx (USDJPY,M15) 12:45:07 Modify parameters : SL=99.389000,TP=97.871000


----------------------------------- 

 and the open price is 98.0 

can somebody tell me why?   

What was the Bid and Ask at the time ?  what are the STOPS LEVEL and FREEZE LEVEL ?  check the return values from your function calls,  when you detect that the modify fails report the error and any relevant variables,  Bid, Ask, etc,  that you need to diagnose the problem.