Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simplest of questions.

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

    #16
    8DTK8,

    Let us start here. Can you please inform me as to the various BarsInProgress series you have. The instrument and time period for them all.
    Josh P.NinjaTrader Customer Service

    Comment


      #17
      I really appreciate this.
      Below is a cut and paste.
      The instrument type isn't defined because I'm only applying the strategy to 1 futures contract at a time. I'm currently applying it to ES data. I don't know if this is relevant, but the particular strategy I'm dealing with only has one trade on at a time. It's either short one contract or it's flat.
      ---

      protected override void Initialize()
      {
      // Timeframe strategy is being applied to = barsinprogress == 0

      // Add a 15 minute Bars object to the strategy = barsinprogress == 1
      Add(PeriodType.Minute, 15);

      // Add a 1 minute Bars object to the strategy = for barsinprogress == 2
      Add(PeriodType.Minute, 1);

      ClearOutputWindow();

      CalculateOnBarClose = true;
      }







      Originally posted by NinjaTrader_Josh View Post
      8DTK8,

      Let us start here. Can you please inform me as to the various BarsInProgress series you have. The instrument and time period for them all.

      Comment


        #18
        What time frame chart do you apply the strategy onto? Daily charts?
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          I have tried running it on multiple timeframes. 5, 15 (to match the first series), 30 and 60. Not daily. They all return the same zeros.

          Thanks.

          Originally posted by NinjaTrader_Josh View Post
          What time frame chart do you apply the strategy onto? Daily charts?

          Comment


            #20
            If you have a simple as possible strategy demonstrating this could you send it my way so I can test it on my end? Thanks.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              Sure. Give me a couple of hours though. I have to dump out the prop indicators and replace them with something more simple so I can send it.

              Originally posted by NinjaTrader_Josh View Post
              If you have a simple as possible strategy demonstrating this could you send it my way so I can test it on my end? Thanks.

              Comment


                #22
                I threw the relevant lines of code into a simple program that shorts off the 20 SMA in the 15 min and then uses the 1 min to look for exits. It's not actually doing that, but there's enough happening that it's printing the part that I want to deal with. I'll clean it up so that more of it works if you think that will help. I just rushed this in the interest of time.

                It still turns up all zeros.

                The strategy is enclosed... I think... not sure if I'm sending it to you the right way. Please send instructions if I didn't send the proper file.

                Thank you very kindly again.



                Originally posted by NinjaTrader_Josh View Post
                If you have a simple as possible strategy demonstrating this could you send it my way so I can test it on my end? Thanks.
                Attached Files

                Comment


                  #23
                  8DTK8,

                  I threw your strategy onto my Strategy Analyzer running on 30min chart of AAPL and I get prints like this:

                  Position is Short with BSE 0 at 9/10/2008 3:00:00 PM
                  Position is Short with BSE 1 at 9/10/2008 3:30:00 PM
                  Position is Short with BSE 1 at 9/10/2008 3:45:00 PM
                  Position is Short with BSE 2 at 9/10/2008 4:00:00 PM
                  Position is Short with BSE 2 at 9/10/2008 4:15:00 PM
                  Position is Short with BSE 3 at 9/10/2008 4:30:00 PM
                  Position is Short with BSE 4 at 9/10/2008 5:00:00 PM
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Thank you again for all of your hard work Josh.
                    I just shut down the Strategy Analyzer, NinjaTrader and rebooted my computer. The exact same strategy is working the way I expect it to now.

                    Just out of curiosity. I notice that the Strategy Analyzer gets buggy sometimes if you run a few backtests and optimizations in the same window. I've solved this in the past by shutting down the program and restarting it. Is Strategy Analyzer only supposed to be run for one optimization or backtest at a time?



                    Originally posted by NinjaTrader_Josh View Post
                    8DTK8,

                    I threw your strategy onto my Strategy Analyzer running on 30min chart of AAPL and I get prints like this:

                    Position is Short with BSE 0 at 9/10/2008 3:00:00 PM
                    Position is Short with BSE 1 at 9/10/2008 3:30:00 PM
                    Position is Short with BSE 1 at 9/10/2008 3:45:00 PM
                    Position is Short with BSE 2 at 9/10/2008 4:00:00 PM
                    Position is Short with BSE 2 at 9/10/2008 4:15:00 PM
                    Position is Short with BSE 3 at 9/10/2008 4:30:00 PM
                    Position is Short with BSE 4 at 9/10/2008 5:00:00 PM

                    Comment


                      #25
                      From my experience I don't think I have ever had any such hiccups when I backtest/optimize my own strategies, but if you find a reproducible scenario we would be glad to investigate it for you.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #26
                        Back to the very very basics.

                        In #region Variables, according to the notation one should get to decide the default setting for variables.

                        Shouldn't this mean that in strategy analyzer that the variables you set as the default show up after saving and compiling?

                        For whatever reason mine doesn't. Not that this is the biggest issue that I'm having, but it did pop up and I thought I would try conquering something small first. For example...

                        privateint sMAdurationLONG = 200; // Default setting for SMAdurationLONG

                        Doesn't this mean that when I pull up the backtest window that it should say 200... and change in the backtest window if I change it to 100 in the script, save then compile?

                        Thank you in advance.

                        Comment


                          #27
                          Losing all of my marbles (if I had any to begin with)...

                          I have a MTF strategy.
                          There are only 2 bar objects (primary and secondary).
                          All of my if statements have "BarsInProgress == 1" as a part of them.
                          It seems to be running fine when there are only 2 bar objects.
                          Why is it that when I add a third bar object it changes my backtest results when nothing else has changed? Or when I modify the third bar object which the system should not be using that my results change.


                          For that matter, why should the results change when the Data series value is changed? If every on bar update condition has "BarsInProgress == 1" then shouldn't the primary series be ignored?

                          Thanks for any help.
                          Last edited by 8DTK8; 10-02-2008, 08:05 AM.

                          Comment


                            #28
                            Hello,

                            For your first question, please put this in your properties section:

                            [Description("")]
                            [Category("Parameters")]
                            public int SMAdurationLONG
                            {
                            get { return sMAdurationLONG; }
                            set { sMAdurationLONG = Math.Max(1, value); }
                            }

                            Notice the capitalizations. Also sMAdurationLONG will need to start with a lower case letter in your variables section.

                            Regarding your most recent post, please post some code and we will take a look.
                            DenNinjaTrader Customer Service

                            Comment


                              #29
                              All the things that you mentioned already exist in my code.
                              I am including a partial screenshot.

                              It compiles just fine but the problem still exists.

                              Originally posted by NinjaTrader_Ben View Post
                              Hello,

                              For your first question, please put this in your properties section:

                              [Description("")]
                              [Category("Parameters")]
                              public int SMAdurationLONG
                              {
                              get { return sMAdurationLONG; }
                              set { sMAdurationLONG = Math.Max(1, value); }
                              }

                              Notice the capitalizations. Also sMAdurationLONG will need to start with a lower case letter in your variables section.

                              Regarding your most recent post, please post some code and we will take a look.
                              Attached Files

                              Comment


                                #30
                                Hello,

                                What exactly is the issue you are experiencing now?

                                If you are having issues with your inputs changing settings in backtesting will not change your code, but the vlaue of 100 will be perserved until the next time you open NT.

                                If you having issues with the BarsInProgress please post code.
                                DenNinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                648 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                369 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                108 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                572 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                573 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X