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

Scaling charts: indicators

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

    Scaling charts: indicators

    Hi NT,

    I built a custom indicator, that outpluts 2 lines:
    - the 16 period SMA of the diffference between the 3 and 10 SMA
    - the 2 period ROC

    But then I plot them, the 2 period ROC, looks pretty flat, obviosly becayse they are sharing the scale. I want both lines on the same pane.
    How do I remedy this please ?

    Thanks
    AK

    #2
    Hello akvevo,

    Thank you for the post.

    You will need to either scale the small values up or scale the large values down manually.

    You could use a multiplier that will scale the plots to make them have the same range as the other indicator.

    For example, if you wanted to scale the smaller values to the larger ones, find the maximum value of the larger plot, then get this ratio:

    Code:
    ratio = 100/max_val_of_large_plot
    Then multiply all values of the small plot by this ratio. If it is not enough, increase the numerator.

    Please let me know if I may be of any further assistance.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris for the valid suggestion, although it doesnt work in practice, becuase it slightly alters the scale of the large values.

      Is it possible to plot both series on the same panel with indepent scales?

      Comment


        #4
        Hello akvevo,

        Thank you for the reply.

        Due to the scaling, it is not possible to display these two plots without the smaller one being dwarfed by the larger plot.

        You can override the OnCalculateMinMax() function to set the scaling relative to the output of the two plots.

        More info on OnCalculateMinMax() here:


        As long as your two values are close to each other, the scaling should work out since there will not be as much of a spread after you scale up the small plot.

        If you do need to plot these without scaling, please consider separating these into two different indicators so they can exist in their own plot.

        Please let us know if we may be of any further assistance.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Haiasi, Today, 06:53 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ScottWalsh, Today, 06:52 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ScottW, Today, 06:09 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ftsc2022, 10-25-2022, 12:03 PM
        5 responses
        256 views
        0 likes
        Last Post KeyonMatthews  
        Started by Board game geek, 10-29-2023, 12:00 PM
        14 responses
        244 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Working...
        X