• 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

How to access backtest Start / End date

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

    How to access backtest Start / End date

    Hi,
    how can I access properties: Start date + EndDate,
    that are set in the UI of the Strategy Analyzer ?

    (in old NT7 these properties were accessible via Property BacktestFrom + BacktestTo)

    #2
    Hello,

    Thank you for the question.

    I am currently looking into what would be the suggested way to do this in NT8. Once I have further details I will reply back.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      Because the properties you had mentioned are not documented, there is no counterpart for NT8. If you can provide the syntax you are currently using in NT7 for the property you had used before, I may be able to get more details if that specific property had been migrated.

      I was able to locate the following Properties of the Bars object:

      Code:
      Print(Bars.FromDate + " - " + Bars.ToDate);
      Depending on how early on you need to know this, the values would be available as soon as Historical or bar 0. If the values were needed prior to that, unfortunately I am unsure of a valid way as Bars is not populated earlier.

      This is the result of the Custom date range selection which is used in a chart as "Custom Range" or in a backtest as the standard date pickers.


      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Thank you.
        I need this at start of the strategy - before any processing of bars,
        and use it to generate my custom statistics.

        The exact syntax, that I used in NT7 is this:
        Code:
        BackTestFrom
        BackTestTo
        • Both are properties of type DateTime.
        • They can be invoked on instance of any Strategy.
        • As these dates are set from UI, I accessed this property from OnStartUp() in NT7.


        As NT8 works similarly = I mean, that these values are also set in StrategyAnalyzer in UI, these should be stored / accessed from some simple property.

        It will be really helpful, if you could provide me with working counterpart for NT8.

        --
        I take my own risk of using it. I am aware, that this is not officially documented Property,
        so I will properly test it and it is potential subject of change anytime without any warning.
        Last edited by misova; 09-07-2016, 02:00 AM.

        Comment


          #5
          Hi misova,
          I have successfully used
          From.Date
          To.Date
          in my strategies
          They are accessible in State.Configure

          Comment


            #6
            Excellent.
            Thank you aerofly, great work !

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by elizajohan, Today, 04:15 AM
            0 responses
            2 views
            0 likes
            Last Post elizajohan  
            Started by timcjpfx, Today, 03:52 AM
            0 responses
            1 view
            0 likes
            Last Post timcjpfx  
            Started by tonynt, Today, 01:42 AM
            0 responses
            7 views
            0 likes
            Last Post tonynt
            by tonynt
             
            Started by NT-Roland, Yesterday, 04:36 PM
            0 responses
            3 views
            0 likes
            Last Post NT-Roland  
            Started by Newtrader101, Yesterday, 03:40 PM
            2 responses
            13 views
            0 likes
            Last Post Newtrader101  
            Working...
            X