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, 10:20 AM.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jstaft, Today, 10:21 AM
    0 responses
    10 views
    0 likes
    Last Post jstaft
    by jstaft
     
    Started by jeliner, Today, 10:22 AM
    0 responses
    12 views
    0 likes
    Last Post jeliner
    by jeliner
     
    Started by jrp2099, Today, 09:10 AM
    2 responses
    14 views
    0 likes
    Last Post jrp2099
    by jrp2099
     
    Started by alcorr247, Today, 09:14 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by soulfx, Today, 09:49 AM
    3 responses
    9 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X