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 CarlTrading, Yesterday, 09:41 PM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      31 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      30 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-25-2026, 09:53 PM
      0 responses
      34 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 03-25-2026, 09:51 PM
      0 responses
      19 views
      0 likes
      Last Post CaptainJack  
      Working...
      X