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

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.
    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        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 CortexZenUSA, Today, 12:53 AM
          0 responses
          1 view
          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