so my first problem is how to change des X and Y axis so that they have the values of close prices and number of occurence .
and my second problem is i have an error after trying this code :
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
for(j = 0 ; j < 259 ; j ++ )
{
for(i = 1 ; i < 259 ; i ++ )
{
if(Close[j] == Close[i] )
{
sum = sum + 1 ;
}
Print("Close : " + Close[j] + " Nbr d'occurence : " + sum + "Current Bar " + CurrentBar) ;
}
}
}
Indicator 'Occurenceprix': Error on calling 'OnBarUpdate' method on bar 0: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
Comment