iRSI in 2 periods - such a wierd issue!

 

Hi all


I'm back-testing an EA using Tickstory data, latest MT4 build and with M5 period in the tester.

I use iRSI for 2 periods - M5 and H4. I save the values like this: 

   rsiM5 = iRSI(Symbol(), PERIOD_M5, 14, PRICE_CLOSE, 0);

   rsiH4 = iRSI(Symbol(), PERIOD_H4  , 14, PRICE_CLOSE, 0);


The thing is, rsiH4 gets "0". I don't get it... and it also happens on other pairs.

When I run the test using period H4 on the terminal, then rsiM5 gets "0".

It used to work. Something with the latest build perhaps?


TX

 
adibi83:

Hi all


I'm back-testing an EA using Tickstory data, latest MT4 build and with M5 period in the tester.

I use iRSI for 2 periods - M5 and H4. I save the values like this: 

   rsiM5 = iRSI(Symbol(), PERIOD_M5, 14, PRICE_CLOSE, 0);

   rsiH4 = iRSI(Symbol(), PERIOD_H4  , 14, PRICE_CLOSE, 0);


The thing is, rsiH4 gets "0". I don't get it... and it also happens on other pairs.

When I run the test using period H4 on the terminal, then rsiM5 gets "0".

It used to work. Something with the latest build perhaps?


TX

Anyone? I really need help here... Thanks

 
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 - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4

The function linked to, opens a hidden chart for the symbol/TF in question (if not already open,) thus updating history, and temporarily placing the symbol on Market Watch (if not already there,) so SymbolInfoDouble(symbol, SYMBOL_BID) or MarketInfo(symbol, MODE_BID) don't also return zero on the first call.

Reason: