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 NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      101 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      156 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      84 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      57 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      73 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X