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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X