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 CortexZenUSA, Today, 12:53 AM
        0 responses
        2 views
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by usazencortex, Today, 12:43 AM
        0 responses
        5 views
        0 likes
        Last Post usazencortex  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,266 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X