Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Autoscale indicator in a strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Autoscale indicator in a strategy

    Hi, I'm adding multiple indicators to a strategy. In Ninja 7, I was able to set the AutoScale property of each indicator that I was adding.

    In NT7

    DonchianChannel dc = DonchianChannel(DonchianPeriod);
    dc.Displacement = 2;
    dc.AutoScale = false;
    Add(dc);

    In NT8 the following doesn't work since SMA doesn't have an AutoScale definition.

    SMA smaRegime = SMA(RegimeLookback);
    smaRegime.AutoScale = false;
    AddChartIndicator(smaRegime);

    I've seen the post that sets IsAutoScale = true/false; in the OnStateChange() method, but that sets all of the indicators either true or false. I just want one set to false and the others set to true.

    How do I get access to an indicators AutoScale property from a Strategy?

    #2
    Hello dynoweb,

    Thanks for your post.

    For NT8:

    AddChartIndicator(smaRegime);
    ChartIndicators[0].IsAutoScale = false;

    Reference: https://ninjatrader.com/support/help...indicators.htm


    edit: corrected my example.
    Last edited by NinjaTrader_PaulH; 12-29-2017, 07:53 AM.

    Comment


      #3
      Got it, thanks, for others looking at this the line

      AddChartIndicators[0].IsAutoScale = false;

      Should be

      ChartIndicators[0].IsAutoScale = false;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      77 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X