Belgium
Experience: Intermediate
Platform: sierra chart & ninjatrader
Broker: deepdiscounttrader.com sierra chart/TT & Interactive Brokers
Trading: ES
Posts: 42 since Aug 2010
Thanks Given: 670
Thanks Received: 30
|
I use the following ninjascriptcode to change the backgroundcolor for certain days on the chart. (see below) The code works ok.
When i want my chart displaying calendardays instead of tradingdays so that weekend days are displayed as empty (no bar-plots) i change the the chart property 'Equidistant bar spacing' to 'false' in the chart properties window. The code does no longer do what i want in that scenario.
How can i change the backgroundcolor for days where there are no plots on the chart ?
Thank you,
protected override void OnBarUpdate()
{
if (CurrentBar < 2) return;
if (Time[0].DayOfWeek != Time[1].DayOfWeek) {
if (Time[0].DayOfWeek == DayOfWeek.Monday)
{
currentcolor = Color.FromArgb(opacity, backColorRed);
BackColorAllSeries[0] = currentcolor;
Plot0.Set(Close[0]);
}
}
}
|