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 chbruno, 04-24-2024, 04:10 PM
        4 responses
        50 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        10 responses
        398 views
        1 like
        Last Post beobast
        by beobast
         
        Started by lorem, Yesterday, 09:18 AM
        5 responses
        20 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by WHICKED, Today, 12:56 PM
        2 responses
        15 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Felix Reichert, Today, 02:12 PM
        0 responses
        4 views
        0 likes
        Last Post Felix Reichert  
        Working...
        X