MODE_LOTSTEP returns 0 if in other chart

 

Hi there guys, fast issue, if i try "MarketInfo(Symbol(), MODE_LOTSTEP);" it returns the lotstep correctly, BUT, if i send ANY other symbol (which is not the one in the chart with the EA or strategy tester) it returns 0, por example:

In US500 chart both "MarketInfo(Symbol(), MODE_LOTSTEP);" AND "MarketInfo("US500", MODE_LOTSTEP);" returns 0.01, BUT, if i change to any other chart " MarketInfo("US500", MODE_LOTSTEP);" returns 0.

So i don't know if it's intended or a bug, but if you try to get the lotstep of a different symbol it returns 0, also tried with US30 with same results, any idea how to fix this?

Thanks!

 
Your topic has been moved to the section: MQL4 e MetaTrader 4 — In the future, please consider which section is most appropriate for your query.
 

MetaTrader 4 does not support testing multi-symbol EAs. it can only test the current symbol.

Only MetaTrader 5 supports testing multi-symbol EAs.

However, when running live it should work provided the symbol is already active on the Market Watch, and data has been synchronised.

You may need to check for 4066 and 4073 errors and and force the data synchronisation.

Forum on trading, automated trading systems and testing trading strategies

Update HST File

William Roeder, 2023.05.25 15:24

Updates automatically when you reference that timeframe.

On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)

 
Fernando Carreiro #:
Your topic has been moved to the section: MQL4 e MetaTrader 4 — In the future, please consider which section is most appropriate for your query.
Sorry, I thought it was the correct one 👍
 
Fernando Carreiro #:

MetaTrader 4 does not support testing multi-symbol EAs. it can only test the current symbol.

Only MetaTrader 5 supports testing multi-symbol EAs.

However, when running live it should work provided the symbol is already active on the Market Watch, and data has been synchronised.

You may need to check for 4066 and 4073 errors and and force the data synchronisation.

So, I can't even open positions on different symbols or is can but there's no way to read lotsize and that kind of stuff ? Should I go for MT5 then?
 
  1. Jose Ma Gassin Perez Traverso #: So, I can't even open positions on different symbols

    In the tester.

  2. Jose Ma Gassin Perez Traverso #: r is can but there's no way to read lotsize and that kind of stuff

    Previously answered, read the link provided. #2

Reason: