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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    47 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X