Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting ChartScales Range programmatically

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

    Setting ChartScales Range programmatically

    Hello!

    I've got a bunch of indicators that plot below the chart panel. When I load them on a chart, the ranges of their scales are set to 'Automatic' by default.

    I've looked at the NinjaTrader documentation about ChartPanel, Scales, and PanelIndex, but I didn't understand how to put all the pieces together.

    Specifically, I'd like to set the scales of these indicators to 'Fixed' from within the indicator code and set the upper MaxValue and the lower MinValue that indicate the maximum and the minimum Y value of objects within the chart panel.

    How should I do that?

    #2
    Hello, thanks for writing in.

    You can override the OnCalculateMinMax event to set a custom price range for your indicators panel:



    This event is triggered when the chart scale is adjusted.

    Kind regards,

    -ChrisL

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    41 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    27 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    45 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    37 views
    0 likes
    Last Post CarlTrading  
    Working...
    X