Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

nt8 strategy analyzer + trix indicator bug

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

    nt8 strategy analyzer + trix indicator bug

    Hi,

    Build a simple test strategy with the NT8 strategy builder: Go long/short if Trix.Default and Trix.Signal are crossing. Using the 'optimize data series' with 20;50;10 minutes.

    All I get is the result for one strategy (20) only. The strategies with a 20, 40, and 50 minute time frame show a performance and # trades row with 0 (see screenshot 1).

    In spite the non existing performance and trades, displaying the chart (screenshot 2), or the executions window (screenshot 3), detailed performance data is available.

    A similar strategy with 2 crossing SMA(), behaved as expected. Strategy is attached
    Attached Files

    #2
    Hello enable, and thank you for your report.

    I am attaching a copy of your strategy with two modifications :

    • I have increased the lookback period to 3
    • I have removed the signal name on the long entry trade

    I would like to verify that you are still able to reproduce your results with this strategy, while I investigate this. This will just enable us to better narrow down what is occurring.


    I will be following up shortly with my results.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi Jessica,

      Thank you for your quick reply.

      Your updated code didn't change anything. Still the same strange behavior.

      Comment


        #4
        Thank you enable. Could I also verify, do you observe the same using the playback connection? This is the connection we will be using for testing. Even if the information is in the pictures you sent us, could you also verify

        • The instrument and expiry
        • The date and time you expected 3 trades to take place
        • The bars type and value

        From the pictures you sent these look like


        • FDAX 09-16
        • I can not determine an exact date and time from your pictures
        • 30 minute bars

        If you could confirm the 1st and 3rd, and supply the missing information for the 2nd, it would be appreciated.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Hi Jessica,

          - Instrument: DAX 09-16 (or any other single instrument)
          - bars type: Don't use a single timeframe like 30 minutes, but an optimized data series like 10;20;1 minutes
          - bars type: tested with renko, minute, and seconds, all show the same behavior
          - indicator: TRIX crossover (other crossover indicators work as expected)

          Testing a single time frame works always as expected. As with the strategy analyzer 'standard' backtest type. So I suppose, using the 'playback connection' will not result in any bug.

          On the other hand, using the strategy analyzer backtest type 'optimization', ticking the checkbox 'Optimize data series' and setting the data series values to let's say 10;20;1 (type minutes, seconds or any other) will get you the bug as shown in the screenshots. It will show the result for 1 timeframe only, the other strategies are shown with a 0 performance. I would expect more or less the same number of trades and performance for every one of this 11 strategies.

          Comment


            #6
            Hello enable, and thank you for your report.


            This behavior was confirmed on our end. We will be investigating this further. Please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.





            Tracking ID: QA-2360
            Last edited by NinjaTrader_JessicaP; 11-02-2016, 11:21 AM.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Hello again enable,

              This behavior is to be expected. The reason this occurs is because every sub-indicator and sub-strategy's historical bars are processed before the outer indicator's bars. Because of this, your indicators had enough bars to trigger a crossover, and your outer strategy did not have enough bars for a trade. If you review your logs you will see messages such as

              Strategy 'TestTrixCrossover/-1': An order placed at '03-Jan-16 17:00:00' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.


              The reason this happens erratically and misses some of your bar values is because on some of your bar values, the crossover gets triggered later, when you have enough bars required to trade.


              To prevent this from occurring, in your strategy, you can use logic like this at the beginning of OnBarUpdate


              Code:
              [FONT=Courier New]foreach (int CurrentBarI in CurrentBars)[/FONT]
              [FONT=Courier New]{[/FONT]
              [FONT=Courier New]  if (CurrentBarI < BarsRequiredToTrade)[/FONT]
              [FONT=Courier New]  {[/FONT]
              [FONT=Courier New]    return;
              [/FONT]
              [FONT=Courier New]  }
              [/FONT]
              [FONT=Courier New]}[/FONT]
              Please let us know if there are any other ways we may help.
              Last edited by NinjaTrader_JessicaP; 11-03-2016, 08:33 AM.
              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                Hello Jessica,

                Your code snippet didn't work for me. Maybe a typo?

                On the other hand, based on your explications, I set 'BarsRequiredToTrade' to 0. With no 'BarsRequiredToTrade', there can't be such a thing as 'order has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.' However, this very same error message popped up in the log file.

                Comment


                  #9
                  My apologies, the word for should have been foreach, I have corrected my snippet.

                  The attached strategy will not produce any errors in your log, however, it will only produce trades for one value. I am investigating this further.
                  Attached Files
                  Jessica P.NinjaTrader Customer Service

                  Comment


                    #10
                    I have determined that, in addition to reducing BarsRequiredToTrade, if you replace

                    Code:
                    [FONT=Courier New] if (CurrentBar == 0)[/FONT]
                    by
                    Code:
                    [FONT=Courier New] if (CurrentBar < Math.Max(Period, SignalPeriod))[/FONT]
                    in your built-in TRIX indicator on your system, you will no longer encounter this. We are working on packing a TRIX indicator that can be nested on our end; this information is being provided to you so you will not have to wait for the next release of NinjaTrader 8.

                    Please let us know if there are any other ways we may help.
                    Jessica P.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Jessica,

                      Thank you for your kind assistance

                      I did some additional tests this morning and can't get the expected results. Screenshot 01 shows the result with the updated strategy as in post #4. Screenshot 02 the output using the recommendations in post #4 and #5 together.

                      Screen capture 03 shows the trades NT8 actually executed (more than 500!; parameters period 6), dispite claiming only 1 trade was made, as shown in the col 'total # trades' in the right top corner of this screenshot.

                      After your sucessful strategy and indicator updates, it seems that only the summary in the upper half of this NT8 screen is not accurate, but the trades itself were executed as expected.
                      Attached Files

                      Comment


                        #12
                        With respect to the Summary tab not updating properly, this behavior was confirmed on our end. We will be investigating this further. Please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.



                        Tracking ID: NTEIGHT-10682
                        Jessica P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by GwFutures1988, Today, 02:48 PM
                        1 response
                        5 views
                        0 likes
                        Last Post NinjaTrader_Clayton  
                        Started by ScottWalsh, 04-16-2024, 04:29 PM
                        6 responses
                        32 views
                        0 likes
                        Last Post ScottWalsh  
                        Started by frankthearm, Today, 09:08 AM
                        10 responses
                        36 views
                        0 likes
                        Last Post frankthearm  
                        Started by mmenigma, Today, 02:22 PM
                        1 response
                        4 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by NRITV, Today, 01:15 PM
                        2 responses
                        10 views
                        0 likes
                        Last Post NRITV
                        by NRITV
                         
                        Working...
                        X