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

Plot Scaling

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

    Plot Scaling

    I've created a bar plot but it plots values on a scale from 0 to current ES value. I would like it to limit the scale to what is in the price area. How can I set the it to do that?

    #2
    Not sure I follow...

    Did you create a custom indicator and have applied this indicator to the price panel?
    RayNinjaTrader Customer Service

    Comment


      #3
      Sorry, let me clarify.

      I have created an indicator which makes specific calculations and I'd like to have the range of the scale for it to be the same as what the range of prices in the price area are. The indicator is in its own panel.

      For instance, currently its range is 0 to 1300 or so. I'd like the range to be 1295 to 1300 (what currently shows in the price panel) so that I can actually see the differences in the bars.

      Hope this makes sense.

      Comment


        #4
        Well the last post didn't include all my text. The current indicator is in its own panel, but I want its range scale to be the same as what the range in the price panel is.

        Comment


          #5
          Hello,

          I recommend building in some logic that would limit the values to what you want and dynamically change the range to what you want to see on the chart. Something like this:

          First - find the min and max on the chart that you want to base your range on and assign it to a variable (range_min and range_max in my example below). You may find this link helpful:


          Next do something like this:

          if(val > range_max)
          {
          val = range_max;
          }

          if(val < range_min)
          {
          val = range_max;
          }

          //then plot val
          DenNinjaTrader Customer Service

          Comment


            #6
            Thanks Ben. That helps.

            What if I just want the range of values in the indicator panel itself to be the actual range of those values? That is, to not start at 0 as a minimum, but instead start at the minimum value actually showing in that panel.

            Comment


              #7
              Hello,

              The panel will auto scale to the values you have visually displayed in the panel.

              For example place a default CCI indicator on a chart and scroll back and forth on the chart: the CCI panel min and max of the panel will change given the displayed values.

              Therefore, if you limit your plots to certain values or not the panel will scale to display those plots.
              DenNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,605 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              8 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              4 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              13 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X