Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

B5 Execution.dbGet parameters?

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

    B5 Execution.dbGet parameters?

    Hello,

    I am trying to use the global function

    DateTime t = DateTime.Now.ToLocalTime();

    NinjaTrader.Cbi.Execution.DbGet(Account,t.AddDays(-2),t)

    I get an error saying that the DateTimeKind is not set properly and that I have to specify a TimeZoneInfo as well, but there is no TimeZoneInfo in DateTime.

    Do I have to use some timezone that NT8 uses internally for calculations? where do I have to find this?

    How to call DBGet properly

    Thank you

    Andreas

    #2
    Hello Andreas,

    Thank you for your post.

    I am not aware of such an item that would be available in NinjaScript let alone DateTime. I will look into this further and follow up with you here.

    Comment


      #3
      Please note that this is an undocumented feature and is subject to change without notice in future releases. I'll go ahead and make a note that this was a core method you were looking to use and treat your request as a vote for it to be documented.

      The error is coming from the local time conversion. The NT DB uses the core globals date time zone which is configured by a user under Tools-> Options.

      Therefore you could simply just use the NinjaTrader.Core.Globals.Now property for your DateTime object

      Code:
      DateTime t = NinjaTrader.Core.Globals.Now;
      
      List<Execution> dbExecutions = NinjaTrader.Cbi.Execution.DbGet(Account,t.AddDays(-2),t).ToList();
      MatthewNinjaTrader Product Management

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      668 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      377 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X