Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing User Choice for Backtest DialogBox Time frame: To & From in Strategy Code?

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

    Accessing User Choice for Backtest DialogBox Time frame: To & From in Strategy Code?

    Hello,

    I am trying to access the user's choice in the Strategy Analyzer backtest dialog box for "Time frame: To" and "Time frame: From" from NinjaScript strategy code. Does anyone know how to do this?

    Thanks in advance!

    ChiTrader2000

    #2
    Unfortunately this is not supported.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      New NT Version should support accessing all Backtest dialog box fields from code.

      Ninja Trader Development Team,

      Is there any way that the next version of Ninja Trader can make all fields in the Backtest dialog box accessible and editable from within a Strategy's C# code?

      Thanks!

      ChiTrader2000

      Comment


        #4
        What is available is shown in this post here: http://www.ninjatrader-support.com/v...06&postcount=5
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          The properties in the link provided in the previous post are already available in the current version, and I have been using them with success.

          What I was asking is would it be possible for the next version of Ninja Trader to make all fields in the Backtest dialog box accessible and editable from within a Strategy's C# code, not just some of the fields accessible?

          For instance, could the NinjaTrader development team make "Session begins (local time)" at least readable, if not writable, in the C# code?

          This would be a very useful feature.

          Thanks,

          ChiTrader2000

          Comment


            #6
            ChiTrader2000,

            Thank you for the suggestion. We will add it to the list of future considerations.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I thought you can access

              this.SessionBegin;
              this.SessionEnd;
              this.StartedAt;
              this.StoppedAt;

              from within a strategy.

              NT support will not cover this as they have already enough to do. And future versions of NT can change undocumented behaviiour.

              Comment


                #8
                zweistein,

                Thank you very much for the information. This will be very helpful. The following lines do in fact compile, but there is no intellisense for these features:

                DateTime d1 = this.SessionBegin;
                DateTime d2 =
                this.SessionEnd;
                DateTime d3 =
                this.StartedAt;
                DateTime d4 =
                this.StoppedAt;

                When I am in a .NET development environment and I type "this.", I expect that the environment developers expose all the available properties.

                I am trying to figure out how I could have figured this out on my own, 1) without intellisense, 2) without documentation (I have read the entire manual, and it's not in there), and 3) having been told by NT support staff themselves on this very forum that this can't be done.

                How did you find out that this was possible? Is there some documentation or manual that has not been made public that I could read?

                Thanks again for the excellent information,

                ChiTrader2000

                Comment


                  #9
                  Please be forewarned: Any "feature" beyond of what's officially supported NinjaScript might break in future versions. SessionBegin/End in particular will not longer be there with NT7, since the session management completely changed. We will provide details with first public beta.

                  Comment


                    #10
                    from time to time i use the microsoft clr debugger. there you see all classes. you can also use objectspy.

                    Comment


                      #11
                      NinjaTrader_Dierk: Thanks for the warning. I will keep that in mind. I will wait for the new version for this particular feature.

                      zweistein: Thanks for the awesome development tip! I will check out the microsoft clr debugger and objectspy!

                      ChiTrader2000

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      673 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      379 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      111 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      577 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      582 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X