elean_trading:
I have a spread variable/array and I want to apply bollinger bands to it, but I cannot figure out how to do it. I searched everywhere and the only info I found is how to apply the iBands indicator on another indicator's data. But I found nothing about how to apply it on a custom array. Can anybody help please? Thank you.
Here is the code:
Bollinger Bands is the standard deviation derived from close and applied to the middle line.
You need to calculate the standard deviation from your series and then add and subtract it from your "middle" value...
Dominik Egert #:
I would really appreciate if you could provide some info on how to achieve that with an array based on a specific lookback period? As even the iStDev function needs an indicator, similar to the iBands function, so I have no idea how to do it with an array. On MQL4 there was the iBandsOnArray/iStdDevOnArray function but on MQL5 there is no such option. Also not much info online on how to do it. Thank you!
Bollinger Bands is the standard deviation derived from close and applied to the middle line.
You need to calculate the standard deviation from your series and then add and subtract it from your "middle" value...
elean_trading #:
I would really appreciate if you could provide some info on how to achieve that with an array based on a specific lookback period? As even the iStDev function needs an indicator, similar to the iBands function, so I have no idea how to do it with an array. On MQL4 there was the iBandsOnArray/iStdDevOnArray function but on MQL5 there is no such option. Also not much info online on how to do it. Thank you!
I would really appreciate if you could provide some info on how to achieve that with an array based on a specific lookback period? As even the iStDev function needs an indicator, similar to the iBands function, so I have no idea how to do it with an array. On MQL4 there was the iBandsOnArray/iStdDevOnArray function but on MQL5 there is no such option. Also not much info online on how to do it. Thank you!
You can take a look at vectors and probably solve it with them with ease.
There is a function called iBandsOnArray for mql4, try to find it converted, or convert by yourself to mql5... You Can get the code of iBands and apply it to an array too...
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 have a spread variable/array and I want to apply bollinger bands to it, but I cannot figure out how to do it. I searched everywhere and the only info I found is how to apply the iBands indicator on another indicator's data. But I found nothing about how to apply it on a custom array. Can anybody help please? Thank you.
Here is the code: