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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X