Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting Y-Axis Range programmatically?

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

    Setting Y-Axis Range programmatically?

    I'd like to set the Y-Axis scale to certain offsets from price, say Close[0] + 50 for the Maximum and Close[0] - 50 for the Minimum. Obviously I don't want to do this manually by entering the values in the properties box each time a new bar is updated so I was wondering if there was a way this could be done programmatically. And if there's not, I'd like to make a request to be able to have the y-axis range centered on the Close of each new bar. As in, you enter an offset for the maximum, and an offset for the minimum in the properties window and the y-axis range of your chart is generated off of the close of each new bar.

    #2
    Hello chnh1,

    Thanks for your post.

    Just to cover the basics, in the data series window you can select "center price on scale". If that does not meet your need, yes you can control programmatically.

    In the Help guide for the method OnCalculateMinMax() is an example of centering based on the close price +/- 50 ticks. You should be able to use that and modify as needed.

    Reference: https://ninjatrader.com/support/help...lateminmax.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      "Center price on scale" mixed with the "Fixed" Range setting in the properties box worked for me! Thanks very much Paul.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by helpwanted, Today, 03:06 AM
      1 response
      16 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      6 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      387 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X