array out of range with Indicator

 

Hey folks,

I simply wanna do the following thing:

if the bollinger bands (upper and lower band) spread out, there should be an arrow on the upper and lower Band be drawn.

For the upper band is it working, but for the lower band I'll get the array out of range error.

May one specialist here can teach me right.

Big thanks in advance!

Greez Dan 

Files:
bollinger.txt  3 kb
 
hilfx:

Hey folks,

I simply wanna do the following thing:

if the bollinger bands (upper and lower band) spread out, there should be an arrow on the upper and lower Band be drawn.

For the upper band is it working, but for the lower band I'll get the array out of range error.

May one specialist here can teach me right.

Big thanks in advance!

Greez Dan 

Hello!

Try add  string "#property indicator_buffers 2" into code:

 

#property copyright "me"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
extern int Bollinger_Open = 5;

...
...
 
ENSED:

Hello!

Try add  string "#property indicator_buffers 2" into code:

 

Thanks a lot!
Reason: