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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      237 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      152 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      163 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      246 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      199 views
      0 likes
      Last Post CarlTrading  
      Working...
      X