Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fixed Y-axis with Autoscroll

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

    Fixed Y-axis with Autoscroll

    I am trying to make an indicator that controls the price y-axis of the main data series so that price stays w/i a fixed range (like 10 points) and when price moves to the upper / lower part of the chart it will re-center automatically. How do I override the chartscale of main data series to do this? Currently I can only make the series wider, but not narrower than the bars shown on the chart

    #2
    Hello habibalex,

    Thanks for your post.

    You may wish to consider using the Data Series "Center price on scale" property. OnCalculateMinMax will allow us to adjust how the indicator is fit when AutoScale is enabled, but this would not allow us to narrow the scale past other chart objects that use AutoScale.

    More information on OnCalculateMinMax can be found here - https://ninjatrader.com/support/help...lateminmax.htm

    You could also consider trying to modify ChartScale.Properties to set the range to Fixed and to adjust the Max and Min from there. Please note that as the Help Guide mentions, these are user controlled properties, and attempting to change them programmatically may not be guaranteed.

    ChartScale.Properties - https://ninjatrader.com/support/help...properties.htm

    We look forward to assisting.

    Comment


      #3
      Center price on scale will not work for me, I need to see some movement up and down in a fixed range. I want it to work similar to how the static super dom works. Is there any way to change the Fixed Max and Min values from an indicator?

      Comment


        #4
        Hello hablibalex,

        Have you tried changing ChartScale.Properties? Changing this programmatically is not guaranteed, as these are intended to be set from the user, but you may find enough functionality to attain your goal.

        Comment


          #5
          Here is an indicator that allows a chart to have a fixed size y-axis and automatically re-center when price gets near the margin:
          Last edited by habibalex; 12-30-2022, 09:46 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          655 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          577 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X