I am not setting arrow buffers values but Indicator is ploting arrows on every bar - page 2

 
Vladislav Boyko #:

As I said above, I did not study the logic of the code. But considering this

empty values from the quote below should be replaced with zeros

I agree it's better to replace EMPTY_VALUE with 0. 
 
Conor Mcnamara #:

if you're trying to make one arrow appear on the states of line color change, then you should modify this part of the code:




and take away the arrow buffer code from there:


All the other initialization code is fine

Thanks for last fix brother, but please see the attached screenshot it is showing weird arrows before the line change plus at the buttom of the chart can you please fix this. Thanks!
Files:
image.png  45 kb
 
I have very little time which means I can't really help you on that so soon.
The looping is very messy in this script which is most likely why this happening. The definition of the j variable shouldn't have "periods + 1" at the end, this makes no sense. And the loop shouldn't start at "j - periods"...it should be kept simple like 
for(i = j; i > 0; i--)
Remove that other loop as well (what I attached) because it's unnecessary and you shouldn't have any buffer modifications in it
 
Conor Mcnamara #:
I have very little time which means I can't really help you on that so soon.
The looping is very messy in this script which is most likely why this happening. The definition of the j variable shouldn't have "periods + 1" at the end, this makes no sense. And the loop shouldn't start at "j - periods"...it should be kept simple like 
Remove that other loop as well (what I attached) because it's unnecessary and you shouldn't have any buffer modifications in it

I am getting array out of range error after doing this brother, please spend some time on it and fix it, i am stucked on this indicator from many weeks, i shall be thankful to you for this,