Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
ChartScale MinValue / MaxValue wrong
Collapse
X
-
ChartScale MinValue / MaxValue wrong
I am working with a DrawingTool in the IsVisibleOnChart function and the returned values for chartScale.MinValue / MaxValue are wrong. There is are 2 properties called SaveScaleMax / SaveScaleMin which appear to have the correct values for the chart. This used to work correctly when I made the drawing tool last year
Tags: None
-
Hello habibalex,
Thanks for your post.
Have you added prints in the script for the SaveScaleMax, SaveScaleMin, chartScale.MaxValue, and chartScale.MinValue properties within the script?
What is the print output reporting for those properties in the NinjaScript Output window?
Please share a reduced test script with use that reproduces the behavior and the exact steps you used to reproduce the behavior so we may investigate this matter further.
Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed.
To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.
To export the test script, go to Tools > Export > NinjaScript AddOn.
We look forward to assisting further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
I've added a Print for IsVisibleOnChart for chartScale.MaxValue / MinValue.
Print("return false AVWAP " + chartScale.MinValue + " " + chartScale.MaxValue); // selected
Print("return true AVWAP " + chartScale.MinValue + " " + chartScale.MaxValue); // not selected
SaveScaleMax / Min is not available through the chartScale object ( looks like it's internal or private )
When I select and unselect the drawing tool with my mouse by clicking near it, I noticed that chartScale.MinValue / Maxvalue changes. I made a test script which shows the same thing
Comment
-
Hello habibalex,
Thanks for your notes.
I was able to reproduce the reported behavior and it appears the chartScale.MinValue and chartScale.MaxValue is printing values related to where the mouse is being clicked.
I have reported this behavior to the Development team so that they may investigate the matter further.
Once the Development team is finished investigating the behavior I will update this forum thread with their findings.
Thanks for reporting this! We look forward to assisting further.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
- Likes 1
Comment
-
Hello habibalex,
Thanks for your patience.
The Development team has finished investigating this behavior.
They have reported that this is the expected behavior for chartScale.MinValue and chartScale.MaxValue for performance reasons when performing a hit test.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
What's the logic behind the values that are returned? if it's not the chart min and max, it must be something? Seems an odd choice to return random values. It'd be better if a flag or null values were returned that indicated it was unknown rather than random values.
Comment
-
Hello habibalex,Originally posted by habibalex View PostWhat's the logic behind the values that are returned? if it's not the chart min and max, it must be something? Seems an odd choice to return random values. It'd be better if a flag or null values were returned that indicated it was unknown rather than random values.
Thank you for your patience.
The reasoning has to do with performance and resource utilization. During a hit test, the values for MaxValue and MinValue are set that way for performance reasons and I believe they are tied to where the mouse is clicked.
Please don't hesitate to reach out with any additional questions or concerns.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment