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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    163 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    82 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    125 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    206 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    185 views
    0 likes
    Last Post CarlTrading  
    Working...
    X