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 RookieKiwi, Today, 06:53 PM
    0 responses
    2 views
    0 likes
    Last Post RookieKiwi  
    Started by kazisl, Today, 05:52 PM
    0 responses
    4 views
    0 likes
    Last Post kazisl
    by kazisl
     
    Started by andrewjoseph939, Today, 02:39 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by trader252, Today, 02:09 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by mballagan, Today, 01:19 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X