-
#property indicator_buffers 8 #property indicator_plots 2 ⋮ SetIndexBuffer(0,ALTBuffer); SetIndexBuffer(1,USTBuffer); SetIndexBuffer(2,HH); SetIndexBuffer(3,LL); SetIndexBuffer(4,stocd); SetIndexBuffer(5,stocv); SetIndexBuffer(6,HH1); SetIndexBuffer(7,LL1); SetIndexBuffer(8,sd); SetIndexBuffer(9,sw);
Indicator_plots is MT5 not MT4.
-
You declare there are eight (8) buffers, but you set index ten (10).
-
int OnCalculate(const int rates_total, int Start()
Either you use the new event calls or you use the old ones. You can't use both.
You should stop using the old event handlers and IndicatorCounted() and start using new event handlers.
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 2016.05.11 -
limit=Bars-counted_bars; for(i=limit; i>=0; i--) { HH[i]=
When counted_bars is zero, limit (and i) equals Bars. But HH[Bars] does not exist. Propgram crashes; array exceeded.
How to do your lookbacks correctly #9 - #14 & #19
William Roeder:
-
Indicator_plots is MT5 not MT4.
-
You declare there are eight (8) buffers, but you set index ten (10).
-
Either you use the new event calls or you use the old ones. You can't use both.
You should stop using the old event handlers and IndicatorCounted() and start using new event handlers.
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 2016.05.11 -
When counted_bars is zero, limit (and i) equals Bars. But HH[Bars] does not exist. Propgram crashes; array exceeded.
How to do your lookbacks correctly #9 - #14 & #19

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello I am new to MQL4 anda trying to write the indicator above which is on tradingview, I dont have any errors but I cant plot any lines. Could you help me, what's wrong?