Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 chart scaling [F] mode

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

    NT8 chart scaling [F] mode

    Hello


    #2
    Hello,

    You can access this property using the following syntax:

    Code:
    ChartControl.ChartPanels[idx].Scales[idx].Properties.YAxisRangeType
    YAxisRangeType can be Fixed or Automatic
    where idx is equal to the Panel and Scale index you are trying to access.

    I look forward to being of further assistance.

    Comment


      #3
      I am trying to set autoscale to automatic using this property:

      Code:
      ChartControl.ChartPanels[0].Scales[0].Properties.YAxisRangeType = YAxisRangeType.Automatic;
      But I get an error (Object reference not set to an instance of an object.).

      I also cannot "read" the value of YAxisRangeType (Same error). I am doing this inside the OnBarUpdate of an Indicator. I simply want to set the scale to automatic at the end of the day, at 031500 time. Is there a better way? Thanks.
      Last edited by RogBear; 08-13-2018, 10:59 PM.

      Comment


        #4
        Hello

        Thank you for the post.

        It looks like something has changed since this post was created, I tested this syntax and also get an error. I was able to use the following successfully to gather the scale and set its properties:

        Ensure you have the following using statements at the top of the file:

        Code:
        using System.Linq;
        using NinjaTrader.Gui.Chart;
        Code:
        if (ChartControl != null)
        {
        	ChartPanel cp = ChartControl.ChartPanels[0];
        	if (cp != null)
        	{
        		ChartScale scale = cp.Scales.First(s => s.ScaleJustification == ScaleJustification.Right);
        		if (scale != null) scale.Properties.YAxisRangeType = YAxisRangeType.Fixed;
        	}
        }
        This includes error checking for null objects. You can control the panel using ChartPanels[0] and then pick the scale needed by its ScaleJustification. ScaleJustification == ScaleJustification.Right

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        168 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        322 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X