- Learn how to design a trading system by RSI
- how to add arrows to this indi and make alert on closed bar?
- I will write the indicator for free
WHEN I TRY TO COMPLITE AND RUN WITH STRICT MODE,IT HAS ERROR AND INDICATOR CORRUPT .WHO HAS EXPERIENCE ABOUT IT.THANKS
for(shift==0,y=0;shift<limit-1;shift++)
if ((RsiMa[i+1]<AlertLevel && RsiMa[i]>AlertLevel ) ||(RsiMa[i+1]>AlertLevel && RsiMa[i]<AlertLevel) ) {for(shift=0,y=0;shift<limit;shift++)
-
Don't SHOUT at us, that is very RUDE.
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor -
Always post all relevant code (using Code button) or attach the source file. We have no idea what i, limit, DnArr, or UpArr are. That is where your problem lies.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem -
Do your lookbacks correctly #9 — #14 & #19
.
Maybe the problem is here
counted=IndicatorCounted(); // counted = 0 if(counted < 1) for(i=Bars - StartBar; i < Bars; i++) { TrLevelSlow[i]=0.0; AtrRsi[i]=0.0; MaAtrRsi[i]=0.0; Rsi[i]=0.0; RsiMa[i]=0.0; } counted=Bars - counted -1; // Bars = 100 // counted = 99 //---- for(i=counted; i>=0; i--) Rsi[i]=iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, i); for(i=counted; i>=0; i--) { RsiMa[i]=iMAOnArray(Rsi, 0, SF, 0, MODE_EMA, i); AtrRsi[i]=MathAbs(RsiMa[i + 1] - RsiMa[i]); // i = 99 // i + 1 = 100 (the index of the last bar is 99) }
- Vladislav Boyko #: Maybe the problem is here
counted=Bars - counted -1; // Bars = 100 ⋮ AtrRsi[i]=MathAbs(RsiMa[i + 1] - RsiMa[i]);
When IndicatorCounted() is zero, counted is Bars-1. RsiMa[i+1] is RsiMa[Bars] which does not exist.
-
Do your lookbacks correctly #9 — #14 & #19
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016)
-
Do your lookbacks correctly #9 — #14 & #19
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016)
Thank you, but I am not the author of the code and the author of this topic. I just suggested where the author of the code could have an array out of range error.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use