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.

    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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      68 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X