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 DynamicTest, Today, 11:18 PM
      0 responses
      3 views
      0 likes
      Last Post DynamicTest  
      Started by dcriador, Today, 01:43 AM
      3 responses
      19 views
      0 likes
      Last Post dcriador  
      Started by smartromain, Today, 10:50 PM
      0 responses
      5 views
      0 likes
      Last Post smartromain  
      Started by popecapllc, 08-09-2023, 07:42 PM
      10 responses
      1,366 views
      0 likes
      Last Post BartMan
      by BartMan
       
      Started by jbays87, Today, 09:46 PM
      0 responses
      6 views
      0 likes
      Last Post jbays87
      by jbays87
       
      Working...
      X