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!
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
NinjaTrader
NT8 chart scaling [F] mode
Collapse
X
-
Hello,
You can access this property using the following syntax:
Code:ChartControl.ChartPanels[idx].Scales[idx].Properties.YAxisRangeType
where idx is equal to the Panel and Scale index you are trying to access.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
I am trying to set autoscale to automatic using this property:
Code:ChartControl.ChartPanels[0].Scales[0].Properties.YAxisRangeType = YAxisRangeType.Automatic;
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
-
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; } }
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
14 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
229 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
||
Started by agclub, 04-21-2024, 08:57 PM
|
3 responses
17 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:42 PM
|
||
Started by TradingLoss, 04-21-2024, 04:32 PM
|
4 responses
43 views
2 likes
|
Last Post
by TradingLoss
Yesterday, 11:40 PM
|
||
Started by cre8able, 04-17-2024, 04:16 PM
|
6 responses
56 views
0 likes
|
Last Post
by cre8able
Yesterday, 09:20 PM
|
Comment