Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer's "Data Series" changes results of Strategy that doesn't use it.

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

    Strategy Analyzer's "Data Series" changes results of Strategy that doesn't use it.

    Hello,

    I have a strategy that never uses BarsInProgress == 0 and instead gets all its entry signals from (and sends its orders to) the following three data series:

    BarsInProgress == 1
    BarsInProgress == 2
    BarsInProgress == 3


    However, I get different Strategy Anaylzer backtest results when I change the Strategy Analyzer's Data Series.

    Why is this?
    I figured the results should be the same regardless of what Data Series I choose in the Strategy Analyzer?

    For example, when I backtest the attached "example.zip" strategy with the Strategy Analyzer's Data Series set to 10 minute Last bars (as shown circled in blue in attached 1.jpg) the results are different then when I have them set to 1 minute last bars.

    Thanks
    Attached Files

    #2
    Hello Matheyas5,

    Thank you for your post.

    Try setting each item specifically. In your code you can set the BarsInProgress index for the ExitShort()s as well. You can also pass the BarsArray into the MACD()s for the CrossBelow.

    Comment


      #3
      Thanks for the response Patrick.

      I changed each item as specifically as I could (as shown in the attached ExampleV2.zip) but the problem is still coming up.

      Two questions with this in mind:

      1. Any ideas what I left out in ExampleV2.zip that is causing the issue?
      2. Is there any documentation that shows a "universal" way of how to assign a BarsArrays to virtually any item? I've found documentation that shows how to assign BarsArrays to specific items, but have not really found any documentation that's explains how to assign them to all types of items.

      Thanks
      Attached Files

      Comment


        #4
        Hello Matheyas5,

        Thank you for your response.

        You can find documentation at the following link: http://ninjatrader.com/support/helpG...nstruments.htm
        Please let me know if you need anything else on that matter.

        In the backtesting I am seeing the same results - except for the last trade which ends differently. Can you provide a screenshot of the trades tab for the 10 minute and one for the 1 minute run? And are these runs on the ES?

        Comment


          #5
          Hi Patrick, the results differ when I run it on extremly different time frames.

          Such as 10 second bars vs 4 hours bars, 30 second bars vs 1 day bars, and so on.

          Comment


            #6
            Matheyas5,

            I am still not seeing differences in the results. I tested 30 seconds, 1 Minute, 60 Minute, and 1 Day.

            Could you provide a screenshot of the results?

            Comment


              #7
              Hi Patrick,

              Attached item 1.zip contains the following 3 PDFs. Page 1 of each PDF shows the backtest results and page 2 of each PDF shows the settings used during the backtest.

              30 second bars.pdf = Shows backtest results/settings when using 30 second bars.
              1800 second bars.pdf = Shows backtest results/settings when using 1800 second bars.
              259200 second bars.pdf = Shows backtest results/settings when using 259200 second bars.

              You'll notice that the backtest results in each of the 3 PDFs are different.

              The 5+ days of historical tick data I used for these backtests can be downloaded from the link below. (Note: I originally got this historical tick data by downloading it from your Continuum connection.)



              Lastly, as shown in attached 2.jpg, I'd like to mention I only had tick data for this symbol in the Historical Data Manager during the backtests mentioned in this post (post #7). I had both Tick, Minute and Daily data in the Historical Data Manager when I did the backtests mentioned in post #3 of this thread. I forget if the issue was exactly the same in post 7# and 3#'s backtests, however the issue did come up in both post #7 and 3#'s backtests.

              I'm not sure if having just Tick data vs having Tick, Minute and Last data in the Historical Data Manager should affect backtest results, but figured I'd let you know just in case.

              Thanks!
              Attached Files
              Last edited by Matheyas5; 03-17-2016, 07:55 PM. Reason: I originally posted wrong dropbox link for the tick data download.

              Comment


                #8
                Hi Patrick,

                Any thoughts on this?

                Thanks!

                Comment


                  #9
                  Originally posted by Matheyas5 View Post
                  Hi Patrick,

                  Any thoughts on this?

                  Thanks!
                  Yes, please excuse my delay.

                  Setting the Close[0] needed for the profit to Closes[2][0] seems to have resolved the differences in runs. So if we need to check BarsInProgress it is best to also ensure we call the exact bar series needed for any items in BarsArray, Close, Open, High, Low, etc.

                  Here is what I changed to see the same result on the more granular series like comparing seconds bar types and tick based bars against each other:
                  Code:
                  			if (BarsInProgress == 2)
                  			{
                  				if (Position.GetProfitLoss([B]Closes[2][0][/B], PerformanceUnit.Points) >= TakeProfit)
                  				{
                  				//	ExitShort("", "ShortOrder");
                  					ExitShort(2,1,"ShortExit1", "ShortOrder1");
                  				}
                  				
                  				if (Position.GetProfitLoss([B]Closes[2][0][/B], PerformanceUnit.Points) <= StopLoss)
                  				{
                  				//	ExitShort("", "ShortOrder");
                  					ExitShort(2,1,"ShortExit2", "ShortOrder1");
                  				}
                  			}

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,605 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  13 views
                  0 likes
                  Last Post Javierw.ok  
                  Working...
                  X