Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access From Date

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

    Access From Date

    Hi,

    I need to access the From Date when doing a backtest. Ideally this could be accessed from the Initialize or OnStartup methods, as I need this information to load historical parameters from a database before the strategy turn on.

    I guess this information is contained in StrategyBase? How can I access this, apart from creating a seperate (and superfluous) input in my own strategy?

    Thanks

    #2
    benoirat, unfortunately there would be no supported programmatic access we could offer for this user property set from the UI - so the custom input you create would be best workaround at this time. We have exposing this info on our feedback list for future consideration though, I've just added your vote in.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by benoirat View Post
      Hi,

      I need to access the From Date when doing a backtest. Ideally this could be accessed from the Initialize or OnStartup methods, as I need this information to load historical parameters from a database before the strategy turn on.

      I guess this information is contained in StrategyBase? How can I access this, apart from creating a seperate (and superfluous) input in my own strategy?

      Thanks
      Just find the DateTime of Bar0.

      Code:
       
      if (CurrentBar == 0) StartDate = Time[0].Date;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by michi08, 10-05-2018, 09:31 AM
      2 responses
      738 views
      0 likes
      Last Post Denver_Wayne  
      Started by sightcareclickhere, Today, 01:55 PM
      0 responses
      1 view
      0 likes
      Last Post sightcareclickhere  
      Started by Mindset, 05-06-2023, 09:03 PM
      9 responses
      258 views
      0 likes
      Last Post ender_wiggum  
      Started by Mizzouman1, Today, 07:35 AM
      4 responses
      18 views
      0 likes
      Last Post Mizzouman1  
      Started by philmg, Today, 01:17 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Working...
      X