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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      36 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      14 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      19 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      22 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X