Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set chart display scaling programmatically

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

    Set chart display scaling programmatically

    Hello,

    I would like to be able to set chart display scaling programmatically so that when my indicator is applied to a new chart, the scale can be set without having to right click in the scale area of the chart panel.

    Is this possible?

    thanks,
    Archie

    #2
    Hello abdunbar,

    Welcome to the NinjaTrader Support Forums!

    You can set the ScaleJustification and AutoScale of an indicator programmatically. For example:

    Code:
    protected override void Initialize()
    {
        AutoScale = false;
        ScaleJustification = ScaleJustification.Left;
    }
    ScaleJustification: http://www.ninjatrader.com/support/h...tification.htm

    AutoScale: http://www.ninjatrader.com/support/h...?autoscale.htm

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Sorry, I wasn't clear. I want to set the scaling to "logarithmic."
      Instead of linear.

      Archie

      Comment


        #4
        I changed my search and found this; http://www.ninjatrader.com/support/f...le+logarithmic

        so unless something is changed, not possible?

        So next idea, I could convert the data with "math.log10" ?

        Comment


          #5
          Originally posted by abdunbar View Post
          Hello,

          I would like to be able to set chart display scaling programmatically so that when my indicator is applied to a new chart, the scale can be set without having to right click in the scale area of the chart panel.

          Is this possible?

          thanks,
          Archie
          That is the default behavior. If you have not switched a chart to "manual scaling", then there is nothing to do. Autoscaling is the default.

          Comment


            #6
            Sorry, I may not understand how this forum works. I was posing a question about how to set a chart scale to "logarithmic" instead of the default "linear" and to do so programmatically. I found a reply in another thread linked below that said not possible. Just wondering if anything has changed?

            Otherwise the only choice is to do the logarithmic conversion of the data and indexing within the script.

            thanks,

            Archie

            Comment


              #7
              Hello Archie,

              Yes, that still is unsupported.

              With that said, you can create a chart template that has both the indicator that you want to apply and be able to save the chart type scale setting to "Logarithmic". So all you would have to do is load the Chart Template to load your indicator and change the setting to "Logarithmic".

              http://www.ninjatrader.com/support/h..._templates.htm
              JCNinjaTrader Customer Service

              Comment


                #8
                JC,

                Thanks, understand.

                Archie

                Comment


                  #9
                  Check out the chartscale indicator sample in the file sharing section here.

                  I used it to peg my battery level indicator at 0 to 100%.


                  Originally posted by abdunbar View Post
                  Hello,

                  I would like to be able to set chart display scaling programmatically so that when my indicator is applied to a new chart, the scale can be set without having to right click in the scale area of the chart panel.

                  Is this possible?

                  thanks,
                  Archie

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  558 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  324 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  545 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  547 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X