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 franatas, 12-04-2023, 03:43 AM
      6 responses
      100 views
      0 likes
      Last Post AuroraForbes  
      Started by traderqz, Today, 04:32 PM
      0 responses
      2 views
      0 likes
      Last Post traderqz  
      Started by futtrader, Yesterday, 01:50 AM
      3 responses
      30 views
      0 likes
      Last Post NinjaTrader_Eduardo  
      Started by proptradingshop, Today, 01:35 PM
      4 responses
      15 views
      0 likes
      Last Post proptradingshop  
      Started by abdo22, Today, 03:15 PM
      2 responses
      10 views
      0 likes
      Last Post abdo22
      by abdo22
       
      Working...
      X