Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing Strategy Analyzer - Time Frame - Start Date from Ninjascript

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

    Accessing Strategy Analyzer - Time Frame - Start Date from Ninjascript

    From my strategy, when I backtest, how can I access the date value in

    Strategy Analyzer >> Time Frame >> Start Date & End Date

    from Ninjascript?

    I want to pre-load some external data when I run a backtest, but not all of the data, just what I need for the back-test period specified in the strategy analyzer.

    #2
    Hello shodson,

    There are not specific properties that I am aware of that represent those times however you could likely do this from OnBarUpdate on CurrentBar 0 using the Time[0] object. That would represent the first datapoint loaded. If you are not using TickReplay you could get the last bar of the series using the index Time.GetValueAt(Count - 2).

    There are some undocumented properties you can try however I am unaware of their normal expectations:

    Code:
    Print(From + " " + To);


    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jesse; 04-07-2020, 11:20 AM.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by MaybellMcKee, Today, 10:18 PM
    0 responses
    1 view
    0 likes
    Last Post MaybellMcKee  
    Started by Lance El Camino, Today, 04:14 PM
    1 response
    12 views
    0 likes
    Last Post s.kinra
    by s.kinra
     
    Started by jtrading82, Today, 04:56 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by dmking, Today, 06:00 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by WHICKED, Today, 03:23 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X