Thank you for your post.
There is no means to set the primary series (chart series) through NinjaScript code. Although you could use SendKeys to send keys to the chart to change the primary bar series. Other than that you could put a check in your code and display a message using DrawTextFixed that advises that the incorrect bar type and value is in use.
For SendKeys, here is an unsupported example:
// check that the bars are Renko and that they are not at the desired 6 value if(BarsPeriod.Id == PeriodType.Renko && BarsPeriod.Value != 6) { // if so, invoke the ninjatrader mini instrument selector which will change the period to the 6RE (6 Renko) MiniInstrumentSelector MIS = new MiniInstrumentSelector(ChartControl, "6RE"); System.Windows.Forms.SendKeys.Send("{ENTER}"); MIS.ShowDialog(); }
Leave a comment: