- copy the bands.mq4 to say bandsOnIndicator.mq4
- Add an extra buffer.
- replace the
for(i=0; i<limit; i++) MovingBuffer[i]=iMA(NULL,0,BandsPeriod,BandsShift,MODE_SMA,PRICE_CLOSE,i);
withfor(i=limit-1; i >= 0; i--){ priceBuffer[i] = iCustom(..., i); MovingBuffer[i]= iMAOnArray(priceBuffer, BandsPeriod, BandsShift, MODE_SMA, i); }
- Replace your iBands code with iCustom(NULL,0, "bandsOnIndicator" ...)
tak88js:
I need the value of the BollingerBand-lines, which apply on indicator data.
If I use the iBands or iCustom function, I have no possibility to choose that it belongs to an indicator
and I don't want to write down the code for every line of the BB to find out if it got crossed.
iBandsOnArray was the solution. Too easy to find it in the first place!
You said you need "BollingerBand-lines, which apply on indicator data." That implies you don't have the indicator code.
Had you said you want to MODIFY an indicator and ADD BBs you would have gotten iBandsOnArray first.

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 need the value of the BollingerBand-lines, which apply on indicator data.
If I use the iBands or iCustom function, I have no possibility to choose that it belongs to an indicator
and I don't want to write down the code for every line of the BB to find out if it got crossed.