I used to say:
if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired || CurrentBars[2] < BarsRequired || CurrentBars[3] < BarsRequired ||CurrentBars[4] < BarsRequired ||)
{return;}
and in so doing, I would never know which Bar was lacking in quantity.
I now say:
if (CurrentBars[0] < BarsRequired){Print("0");return;} //tick
if (CurrentBars[1] < BarsRequired){Print("1");return;} //day
if (CurrentBars[2] < BarsRequired){Print("2");return;} //min
if (CurrentBars[3] < BarsRequired){Print("3");return;} //sec
if (CurrentBars[4] < BarsRequired){Print("4");return;} //10 min
so that I know.
As it is, It seems that no matter how many Day bars I load, whichever bar is a day bar prints its BarsArray number due to lack of bars available (Chart calls for 5 but you only have 4 error).
Am I doing something egregiously wrong? If I load 3 days of data, and only need to calculate yesterday's Pivot Point, I set bars required to 1, and I get an error print on Bar 1 (day).
If I am calcing a 10 day SMA of volume, and I load 10 days of data, I get an error on Bar 1 (day).
If I am doing an intraday calc, and I load 2 days of data with two bars required, I get an error on Bar 1 (day).
I am obviously making a wholesale mistake because this happens Ad Nauseum. I have read the multibar strategy page in help dozens of times...
What am I missing?
Regards,
Andrew;}
Comment