I am getting an out of bounds error with the following code and I am hoping that it is something stupid and easily rectifyable. Any ideas why?
protectedoverridevoid OnBarUpdate()
{
if(CurrentBar <= 500)return;
{
for (int bBar = 2; bBar < 49; bBar++)
{
bValue = Low[bBar];
for (int aBar = 3; bBar < 48; aBar++)
{
aValue = High[aBar];
for (int xBar = 4; xBar < 47; xBar++)
{
xValue = Low[xBar];
}
}
if((High[1] > BullCa() -5)
&& (High[1] < BullCa() +5))
{
Plot0.Set(bValue);
};
Print("bValue = " + bValue + " :aValue = " + aValue + " :xValue = " + xValue + " :cValue = " + BullCa());
}
Comment