• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 leodrz, Today, 09:45 PM
    2 responses
    13 views
    0 likes
    Last Post leodrz
    by leodrz
     
    Started by habibalex, Today, 09:30 PM
    0 responses
    7 views
    0 likes
    Last Post habibalex  
    Started by Herrwolf1, Today, 09:07 PM
    0 responses
    5 views
    0 likes
    Last Post Herrwolf1  
    Started by nomadmilo, Today, 08:52 PM
    1 response
    8 views
    0 likes
    Last Post nomadmilo  
    Started by jvanelli, Today, 08:48 PM
    0 responses
    5 views
    0 likes
    Last Post jvanelli  
    Working...
    X