Indicator Arrows not working - why???

 

Hi,


I have created my first basic indicator which was working fine until i tried adding arrows to it.

The indicator is a basic envelope indicator which sounds an audio alert and prints a message when the price hits the top or bottom 15% envelope of the 5EMA (minus a 20 point buffer - to give me a heads up). This was working find until i added code for a feature which would also draw an arrow when the above criteria was met, i.e. an up arrow when the price hit the lower envelope and a down arrow when it hit the upper envelope. Unfortunately, the new code does not work and i cant see any arrows being drawn.

I have banged my head against this for a day and still cant nut it out, I have attached the indicator with the code for the arrows, any help would be greatly appreciated.

Thanks in advance.

 

You should be getting the Red arrows . . . I did . . . to get both add this line . .

#property indicator_chart_window
#property indicator_buffers 2   //  <-----  add this
 

Thanks heaps RaptorUK,

Yep, both arrows show now, but only from the point in time when you apply the indicator to the chart. I was wondering if its possible to get the arrows to show up on the whole chart i.e. on the bars that have passed also. Would you know how to get this to work also? This seems to happen in the instance when the indicator is applied to a chart that has price action currently outside the envelope, but the same arrow ends up being applied to all the bars, so this is not correct.

Any ideas?

Thanks again.

Reason: