Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Minimum number of days data loaded on chart
Collapse
X
-
Minimum number of days data loaded on chart
Hi, I want to return a bool by checking minimum number of days data loaded on the chart when I add my indicator to the chart. I could not find anything in help guide. Can you please advise where should I add this during the loading cycle and what is the syntax for it?Tags: None
-
Hello asmmbillah,
Thank you for your post.
You could loop through BarsArray[0] within State.DataLoaded and check the timestamps to count the number of days loaded. See the attached example script that demonstrates how this would be accomplished.
In the example script, we loop through BarsArray[0]'s bars with bar indexes since we have not entered a data processing state where BarsAgo references can be used. We then get the day and compare it to a variable to see if we get a new day, and we count them.
See the help guide documentation below for more information.
BarsArray - https://ninjatrader.com/support/help..._barsarray.htm
Let us know if we may assist further.Attached Files<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>
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
57 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
78 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
39 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
101 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
61 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment