Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Paul H.NinjaTrader Customer Service

    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 Spiderbird, Today, 12:15 PM
      0 responses
      4 views
      0 likes
      Last Post Spiderbird  
      Started by lorem, Yesterday, 09:18 AM
      3 responses
      13 views
      0 likes
      Last Post lorem
      by lorem
       
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      12 responses
      42 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by FrazMann, Today, 11:21 AM
      0 responses
      6 views
      0 likes
      Last Post FrazMann  
      Started by geddyisodin, Yesterday, 05:20 AM
      8 responses
      52 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X