OrderSend error 130

 

Hi, i've coded a simple expert advisor, that buy when RSI is under 30, it work perfectly on forex pair like EUR/USD but it don't work on stock pair like AMZN or on BTC/USD for example. I have this error message each time a send order must be sent: BTCUSD,M5: OrderSend error 130 in the journal section of the backtesting panel.

Why it only work on forex and not on other index?

 
Greg MK: Why it only work on forex and not on other index?

Because other symbols have other requirements/limits. Fix your broken code.

 
Greg MK: Hi, i've coded a simple expert advisor, that buy when RSI is under 30, it work perfectly on forex pair like EUR/USD but it don't work on stock pair like AMZN or on BTC/USD for example. I have this error message each time a send order must be sent: BTCUSD,M5: OrderSend error 130 in the journal section of the backtesting panel. Why it only work on forex and not on other index?

There are already way too many threads about "OrderSend Error 130". So please, search before you post.

 
what are the requirements and limits to change for the AMZN index for example?
 
Greg MK #: what are the requirements and limits to change for the AMZN index for example?

Error 130 is "Invalid stops". Your code has to read the symbol's contract specifications and adjust the trading conditions based on that information.

Things like the Stops Level, Freeze Level, Tick Size, etc. will affect how your prices for stops should be calculated.

Please read the following ... Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial

Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
  • book.mql4.com
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
 
Thank you