I'm wondering if there is a "better" or more direct way to acquire an indicator's ChartScale object after State.DataLoaded?
This is how I'm getting the CS object, and it appears to work fine, but it seems like there should be a more direct way.
[COLOR=#000000]if(State == State.Transition)
{[/COLOR][INDENT][FONT=Arial][COLOR=#000000]// [/COLOR][COLOR=#4e5f70][I]Indicator runs on the primary bars panel.[/I][/COLOR][/FONT][/INDENT][INDENT][COLOR=#000000]ScaleJustification sj = ChartBars.Properties.ScaleJustification;
foreach (ChartScale scale in this.ChartPanel.Scales) // _chartPanel.Scales)
{[/COLOR][/INDENT][INDENT=2][COLOR=#000000]if (scale.ScaleJustification == sj)
{[/COLOR][/INDENT][INDENT=3][COLOR=#000000][B]chartScale = scale;[/B]
// Print(" - FloatingChart: maxPrice = "+chartScale.MaxValue+" \tminPrice = "+chartScale.MinValue );
// Print(" - FloatingChart cScale size = W: "+chartScale.Width+" \tH: "+chartScale.Height );[/COLOR][/INDENT][INDENT=2][COLOR=#000000]}[/COLOR][/INDENT][INDENT][COLOR=#000000]}[/COLOR][/INDENT]
[COLOR=#000000]}[/COLOR]
PS, an example code should be added to the ChartScale documentation page at... https://ninjatrader.com/support/help...chartscale.htm

Comment