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 andrewtrades, Today, 04:57 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            3 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X