Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars loaded after DataLoaded state

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

    Bars loaded after DataLoaded state

    Does the data accessible in DataLoaded state include the bar in progress? Say I use Close.GetValueAt(Close.count - 1), which should be the last element of the array, do I get the close of the bar in progress in the chart or the one before?

    #2
    Hello amaltais,

    Thank you for your post.

    BarsInProgress is an index value of the current Bars object that has called the OnBarUpdate() method.

    Instead of using Close.GetValueAt, you could use plural Series objects such as Closes[ ].GetValueAt. Closes holds an array of Series<double> objects holding historical bar Close prices. To reference the current bar, you would use Closes[0].GetValueAt. The previous bar would be referenced as Closes[1].GetValueAt.

    Please see this help guide link for more information about Closes[ ] - https://ninjatrader.com/support/help...ightsub=Closes

    Also, see this help guide link about BarsInProgress for more information - https://ninjatrader.com/support/help...inprogress.htm

    Let us know if we may assist 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>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X