Add(PeriodType.Day, 1); //Add Day Bars to Index location 1
I then tied a data series to day bars using,
private DataSeries ppDS;
and
if(ppDS == null) // Only to sync the ppDS DataSeries to Day Bars
{
ppDS = new DataSeries(SMA(BarsArray[1], 2));
}
I also have a logic test for dars required,
if(CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired)
return;
Just now when I was debugging a problem using visual Studio and running the script on a Day chart, so CurrentBars[0] and CurrentBars[1] are both day bars, I noticed that CurrentBars[0] is stuck at -1 during the whole run?
This must be something to do with that fact that I have added day bars to my script and am running on a Day chart or is this behaviour unusual.
Should I get round it with a logic check to see if the Primary data series is Day Bars?
Comment