I'm trying to plot a weekly box style bar on a daily chart programmatically but to no avail. I have coded the following:
else if (State == State.Configure)
{
AddDataSeries(BarsPeriodType.Week, 1);
}
....
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
{
return;
}
if (BarsInProgress == 1)
{
if (Close[1][0] > Open[1][0] && ChartBars.Properties.ChartStyleType == ChartStyleType.Box)
{
BarBrushes[0] = Brushes.LightGreen; // How to BarBrushes a higher time frame bar?
CandleOutlineBrushes[0] = Brushes.LawnGreen; // How to CandleOutlinerBrushes a higher time frame bar?
}
else
{
BarBrushes[0] = Brushes.Pink;
CandleOutlineBrushes[0] = Brushes.Red;
}
}
else
{
return;
}
}
The code compiles but does not plot properly. I can do it manually by adding a data series panel by hand. Is there a way to plot a weekly (higher time frame) bar on a daily chart programmatically? I can't find any documentation or examples on how to do so.
Any suggestions would be appreciated!
Thank you.
Richard
Comment