Just curious. I'm sure it something I'm doing wrong but, I have added a Volumetric data series to my script which is being ran on my ES 60 min chart.
The script is simply:
else if (State == State.Configure)
{
// adding volumetric series to the script
AddVolumetric(null, Data.BarsPeriodType.Month, 1, Data.VolumetricDeltaType.BidAsk, 1);
}
else if (State == State.DataLoaded)
{
}
}
protected override void OnBarUpdate()
{
int mainChartBarsIndex = 0;
int monthlyChartBarsIndex = 1;
DrawVerticalLinesAtStartOfPeriod(monthlyChartBarsI ndex);
// PrintVolumetricBarData(monthlyChartBarsIndex);
}
private void DrawVerticalLinesAtStartOfPeriod(int currentBarIndex)
{
int barSeriesToUse = CurrentBars[currentBarIndex];
if (barSeriesToUse == -1)
{
Draw.VerticalLine(this, "Zero current bar", BarsArray[currentBarIndex].GetTime(barSeriesToUse + 1), Brushes.Green);
}
else if (barSeriesToUse == 0)
{
Draw.VerticalLine(this, "One current bar", BarsArray[currentBarIndex].GetTime(barSeriesToUse + 1), Brushes.Red);
}
}
So as you can see I've added a volumetric series with period type month and value of 1.
I am then simply drawing vertical lines on the new months (green for the first full month and red for the second).
However if you see my screenshot, the months aren't starting on the 1st trading day which would be the 1st Dec 2021 and 3rd Jan 2022. They are instead a day earlier?
Any help would be appreciated.
Thanks very much,
Tarik

Comment