Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetDayBar MarketReplay does not work

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

    GetDayBar MarketReplay does not work

    Is Bars.GetDayBar( x ) supported in Replay Connection? It is always returning a null Bar in Replay Connection.

    In the Strategy Analyzer and Historical Backfill with a live connection it is returning bars.

    But in Replay, even the historical backfill is not returning any Bar.

    I attached a strategy script that demonstrates it.

    Open the NinjaScript Output window.

    The query for GetDayBar runs on the 1st bar of the session.

    If a Bar is returned the script prints
    Found at least one GetDayBar
    else prints
    No bars foound in GetDayBar



    Attached Files

    #2
    Hello Brillo,

    I took a look at the script however I am not able to see what the problem is from the given logic. I tried a more simple test on my end and see this working:

    Code:
    protected override void OnBarUpdate()
    {
        if (Bars.IsFirstBarOfSession)
       {
          Bar bar = Bars.GetDayBar(1);
          if (bar != null)
          {
             Print("Bar found");
          }
       }
    }
    I would suggest to start by doing a simple test like the above to confirm if that works in a new strategy. If so that points to something you are doing in the logic, if not that points at something related to data. Please ensure that you have loaded historical data for the symbol for the number of days back you are trying to retrieve.

    Comment


      #3
      Thanks Jesse. for some reason it's working today. Maybe it was data related.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X