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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        78 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X