Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Account for splits in backtests

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

    Account for splits in backtests

    I am trying to account for splits when backtesting/optimizing. For example I am testing a strategy on TQQQ which has had several splits over the years, I will notice that on those days if I have a position my position is not adjusted for the split, for example I will be long 1 share at $100, then a 2:1 split will occur and when I close the position it will close at the new split adjusted price but not the correct qty which would now need to be 2 shares at $50. I have tried checking and unchecking adjust for splits. (I am using iqfeed as my data provider and testing this strategy on intraday timeframes). Any help would be appreciated.

    #2
    Hello proptradingshop,

    Thank you for your post.

    The split would be automatically is applied the data the same way it works on a chart, but it doesn't adjust a strategy position, unfortunately.

    That being said, I've created a feature request for splits to automatically be applied to the position size when backtesting. This request is being tracked under the number SFT-5509.

    As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

    Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the reply Kate, so what is the workaround here? Seems like backtests/optimizations are useless if this is not accounted for. Any advice would be appreciated, thank you.

      Comment


        #4
        Hello proptradingshop,

        Thank you for your note.

        Unfortunately I don't have a workaround for this - you can't just suddenly increase a position out of nowhere when backtesting as it wouldn't be able to report the correct PnL because you didn't actually make entries at the split price. This would need to be a feature request.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thanks for the support Kate, so just to make sure I understand correctly, I can not correctly backtest/optimize strategies on stocks which have had a split within the backtest/optimization period is what you are saying?

          Also I don't think your statement above is correct, if I enter long 1 share at $100 and then the stock does a 2:1 split, then I exit my position, it should exit 2 shares at $50, but currently in my backtests it shows that I enter long 1 share at $100, a split happens and I exit 1 share at $50. This is completely throwing off all metrics for a strategy and renders the backtester/optimizer useless if this is not accounted for or no workaround exists.

          I hope what I am trying to convey makes sense here.
          Last edited by proptradingshop; 04-20-2022, 03:34 PM.

          Comment


            #6
            Or even if the amount of contracts remains the same the entry price should be adjusted.

            Comment


              #7
              Can I please get a confirmation that NT is unable to correctly backtest intraday strategies on stocks with splits?

              Comment


                #8
                Hello proptrading shop,

                Thank you for your replies.

                It would adjust the price but there would not be a way to automatically adjust the position quantity, that is correct.

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  Hey Kate thank you for the reply, my point is it is neither adjusting the qty or price. Please read my scenario above, is this the expected behavior?

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by WilliCarls, Today, 02:01 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post WilliCarls  
                  Started by Pa_Baz, 12-14-2024, 09:40 PM
                  47 responses
                  793 views
                  1 like
                  Last Post Gianmarco Giorgi  
                  Started by powbordon1126, 02-06-2025, 08:47 PM
                  3 responses
                  28 views
                  0 likes
                  Last Post rockmanx00  
                  Started by dhanushatrader96, Yesterday, 10:24 PM
                  1 response
                  12 views
                  0 likes
                  Last Post bltdavid  
                  Started by reynoldsn, Yesterday, 07:52 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post reynoldsn  
                  Working...
                  X