I am working on an indicator that uses Values[x][x] variables.
I added AddPlot for all of them, created the code, but at the Values[3][0] i get error.
Part of my code :
[CODE]
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 500)
return;
if ( x < y )
Values[1][0] = 1;
else Values[1][0] = 0;
if ( x1 < y1 )
Values[2][0] = 1;
else Values[2][0] = 0;
if ( x2 < y2 )
Values[3][0] = 1;
else Values[3][0] = 0;
[CODE]
I added prints to each section, and at the third section I get an error, regardless of how many bars i set to countedbars.
I read the documentation about Values function, but am I still missing something?

Comment