Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.GetDayBar(1).Close is always Throwing Null

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

    Bars.GetDayBar(1).Close is always Throwing Null

    Hi,

    I am trying to get Previous Day High, Low, Open and Close using Bars.GetDayBar(1).High (etc) but it is returning null. I even tried to add AddDataSeries(Data.BarsPeriodType.Day, 1) and use BarsArray[1].GetDayBar(1).Close but still the same error. How do I fix this?

    Thanks.

    #2
    Hello kezyclaire,

    Thanks for your post.

    To get the previous day's Open, High, Low, and Close price you could use the Prior Day OHLC indicator method.

    For example, PriorDayOHLC().PriorHigh[0] would be used to get the previous day High price.

    See this help guide page for more information about PriorDayOHLC(): https://ninjatrader.com/support/help...r_day_ohlc.htm
    <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


      #3
      Hi Brandon,

      That works, thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X