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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
566 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
548 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment