Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not running in NT7

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

    #16
    This is what you will see in a backtest in the output window below, the output window I showed you in my previous post was running the strategy live on a chart. You wont have the **NT** Message in backtesting.

    *
    0
    0
    0
    0
    0
    0


    Please make sure that you have data for the instrument you are backtesting. To test this create the free connection to yahoo and backtest on daily data. Before you backtest connect to yahoo using the guide below:



    Then create a chart of MSFT for daily data and make sure you have chart bars. Now open the strategy analyzer and run this strategy on MSFT daily and let me know if you experience the same issue.
    BrettNinjaTrader Product Management

    Comment


      #17
      Can I send you my script, so you can try it? I haven't a hair left in my head.

      Comment


        #18
        Hello,

        Yes, please send it to support at ninjatrader dot com and reference this forum post and put ATTN: Brett and we will take a quick look at the script file.

        I look forward to assisting you further.
        BrettNinjaTrader Product Management

        Comment


          #19
          NT7 starts with strategies disabled by default. Is it enabled?

          Comment


            #20
            Aviat,

            Thanks for the tip!

            He is running a backtest so there is no need to enable it. This is important when you run a strategy live however.

            I received your code. I am running TrendTrack and imported the file. The only changes I made was I added 2 Prints statements 1 to onBarUpdate and 1 to Initialize and it worked as expected. No Orders where generated however so you have logic errors that submit the orders however the code does run.

            It sounds like you dont have data and this is why the strategy will not run. Or you have some difference in the settings you are using when you run the strategy that is different from mine.

            Please insure that you have data for the instrument you are running the strategy on.



            Let me know if I can be of further assistance.
            Attached Files
            BrettNinjaTrader Product Management

            Comment


              #21
              Welll... I am truly lost, the strategy runs fine in 6.5 (and submits orders) and I can run one of the sample strategies right along side TrendTrack and the sample strategy submits orders. ???

              Comment


                #22
                Sleeping Troll,

                If your strategy can print OnBarUpdate() events like what Brett has shown in his screenshot that would mean the strategy is running. The next step after that would be to add Print() in your code and check the if-statements prior to any of your order placement codes. You want to ensure the code is evaluating to true for your if-statements.
                Josh P.NinjaTrader Customer Service

                Comment


                  #23
                  How can it be that I can run sampleMACrossover along with TrendTrack, sampleMACrossover submits orders TrendTrack does not, but TrendTrack runs fine and submits orders in 6.5? Could it be my indicators? I get no errors in log and all is well with them in 6.5.

                  Comment


                    #24
                    Nice look for forum! I still cannot run my script though. Is this a new release of phpbb3? ah, vBulletin 3.8.5 nice, have to check it out.
                    Last edited by Sleeping Troll; 05-26-2010, 09:16 PM.

                    Comment


                      #25
                      Hello,

                      Unfortunately there is only so much we can do to debug your script for you. Since we do not write code for customers. If you think this is a bug issue with 7 and not a scripting/coding issue then you will need to simplify your code down into the section that does not work as you expect so that we can look into that for you. However we cannot look through and debug the entire strategy.

                      Have you tried adding the Print statements as Josh suggested? As this is the next step in the debugging / programing process. You need to do the same as what I just did in the code you sent me and I attached in the screenshot, however you need to put these in the spots leading up to and ultimately where your orders are submitted. Then check to see what get outputted to the output window. This way you can check to see what gets run and when.

                      Ultimately the if statements you are using must be true for the order to be submitted. At this point they are not evaluating to true therefor you need to find where it is exactly not and to do this you need to use Print Statements.

                      Since the code runs in 6.5 and not in 7, I would recommend taking a look at this document and combing though your code and making the changes that need to be done as described in this document.

                      Code Breaking Changes in NinjaTrader 7.
                      Contains critical information including but not limited to migration, installation, connections and changes.


                      Let me know if I can be of further assistance.
                      BrettNinjaTrader Product Management

                      Comment


                        #26
                        OK, I have narrowed the problem down to this...

                        "TrendTrack" uses Fibonacci "channels" these are described in the indicator "Fibs" as upper and lower values, here is a code sample.

                        Code:
                        HighPrice = CurrentDayOHL().CurrentHigh[1];
                        LowPrice = CurrentDayOHL().CurrentLow[1];
                        OpenPrice = CurrentDayOHL().CurrentOpen[1];
                        H.Set(HighPrice);
                        DrawText("H","High",0,HighPrice,Color.Black);
                        H90.Set(Instrument.MasterInstrument.Round2TickSize((HighPrice-OpenPrice) * .90)+OpenPrice);
                        FibH90 = H90[0];
                        if (Input[0] >= H90[0] && Input[0] <= H[0])
                        {
                        	CurrentChannelLower = H90[0];
                        	CurrentChannelUpper = H[0];
                        }
                        DrawText("H90Text","90%",0,H90[0],Color.Black);
                        Here is the code section in TrendTrack that retrieves these values.

                        Code:
                        Upper = Fibs().CurrentChannelUpper;
                        Lower = Fibs().CurrentChannelLower;
                        These values are being returned as "0", A problem I might expect if I were drawing the values from a data series with an index of [0], a new bar had just started and the value had not yet been set; however you can see that I am assigning the values to non-dimensional vars (CurrentChannelLower & CurrentChannelUpper) immediatley after setting the dataseries values. The indicator is working as I have it plotting in my chart, any ideas?
                        Last edited by Sleeping Troll; 05-27-2010, 12:24 PM.

                        Comment


                          #27
                          I have changed all of my dataseries indexes, save Input[] to [1] and still CurrentChannelUpper and CurrentChannelLower are returning "0".

                          Comment


                            #28
                            Hello,

                            I took a quick look at the Fib Indicator. The issue is with how you are exposing the variables. There should be no public variables, you may have been able to do this in 6.5 however this was not supported and is not supported in 7.

                            Please use this reference sample to change for the double CurrentChannelLower and CurrentChannelUpper are exposed.



                            Let me know if I can be of further assistance.
                            BrettNinjaTrader Product Management

                            Comment


                              #29
                              Thx Brett, that sounds like it ought to do it!

                              Comment


                                #30
                                Hey, just wondering... no offense but NT is a tremendous memory hog. It seems to me that requiring all public vars to be arrays just compounds the problem. What is the justification for this?
                                Last edited by Sleeping Troll; 05-27-2010, 06:51 PM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                626 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                359 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                105 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                562 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                567 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X