srh124: I want it to be updated in each tick as it is for standard RSI indicator.
for(i=prev_calculated; i<rates_total; i++) { RSIBuffer[i]=iRSI(NULL,0,InpRSIPeriod,PRICE_CLOSE,i);
You return rates_total, therefor on the next tick prev_calculated is rates_total. Your for loop runs while rates_total < rates_total. Why does not updating surprise you?
How to do your lookbacks correctly #9 — #14 & #19
William Roeder #:
You return rates_total, therefor on the next tick prev_calculated is rates_total. Your for loop runs while rates_total < rates_total. Why does not updating surprise you?
How to do your lookbacks correctly #9 — #14 & #19
Thanks a lot man for your hint.
I corrected my code as follows and it works:
for(i=0; i<=rates_total-prev_calculated; i++) { RSIBuffer[i]=iRSI(NULL,0,InpRSIPeriod,PRICE_CLOSE,i); }
Anyway, am i in correct way? I mean writing above code (which works fine) is logically (regarding MQL programming) correct? or i should do it another way?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I've written a Zigzag-RSI indicator combining RSI values to standard Zigzag indicator. It works pretty well, except that drawing of RSI values does not update on chart (i.e. indicator window). I want it to be updated in each tick as it is for standard RSI indicator.
Here is the code: