I'm trying to set the Horizontal Grid Line Interval although it doesn't have any effect. I've tried with the code below in both an indicator and a chart style but when outputting chartScale.Properties.HorizontalGridlinesInterval to the output windows it still returns 0 and has no effect on the chart. Should it have the desired effect?
Example code is below, I've also added the 4 lines within the OnRender method to the CandlStyle chart style but also has no effect.
Thanks
namespace NinjaTrader.NinjaScript.ChartStyles
{
public class GridLinesChartStyle : ChartStyle
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Chart style here.";
Name = "GridLinesChartStyle";
ChartStyleType = (ChartStyleType) 8;
BarWidth = 2;
}
else if (State == State.Configure)
{
}
}
public override bool IsTransparent { get { return false; } } // replace with your logic to check if entire style is transparent
public override int GetBarPaintWidth(int barWidth)
{
return 1; //replace with your bar width logic
}
public override void OnRender(ChartControl chartControl, ChartScale chartScale, ChartBars chartBars)
{
chartScale.Properties.HorizontalGridlinesIntervalT ype = HorizontalGridlinesIntervalType.Ticks;
chartScale.Properties.HorizontalGridlinesInterval = 1;
base.OnRender(chartControl, chartScale, chartBars);
Print(chartScale.Properties.HorizontalGridlinesInt erval);
}
}
}
Comment