Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using two scales in custom indicator

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

    Using two scales in custom indicator

    I'm looking for a sample indicator that uses chart scales.

    I have a custom indicator that is basically two separate indicators on the same panel that use the same data. One is a plot of the cumulative sum of the past 20 bars of data. The other is a series of bars each representing the data in the cumulative sum plot. Obviously the scales will be drastically different as one is the sum of 20 of the other. What I would like to do is have the bar feature use it's own scale on the left while the cumulative sum plot uses the scale on the right. How would I go about this? Since the underlying data for both indicators is tick based and resource hog, I'd like them to share the same panel or I would simply create two different indicators and then move one to overlay the other.

    The bar indicator is just a line drawn with the drawing tool, programmatically. Am I going to need to code my own scaling logic or can I leave that function to NT somehow?

    #2
    Hi Chippy, thanks for writing in. The best thing to do will be to separate the indicators, overlay them, set one indicator's scale justification to Overlay so it will not auto scale with the other indicator. If the bar indicator is only drawing a line, there is an option in the Line drawing tool overload to set AutoScale to false, then the line will not affect the scaling of the chart.

    Kind regards,
    -ChrisL

    Comment


      #3
      Thanks Chris. I am already experiencing screen lag during heavy trading. Is there any way to keep the two indicators as one (and still use two different scales) to avoid the redundant overhead of tick based calculations?

      Comment


        #4
        Hi Chippy, the indicator can be kept as one if there is one plot and the other is a simple line draw object. Like I said in my first reply you can disable Auto Scale for that line and it will not effect the scaling of the chart. The other workaround is to render the graphics using OnRender:



        Kind regards,
        -ChrisL

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        367 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        570 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X