Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strat performance and Strat Analyzer historical data different?

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

    Strat performance and Strat Analyzer historical data different?

    Hi,
    I noted that if I run the exact same strategy and parameters in the strategy analyzer and live that I see a difference in the trades. I traced the problem down to the fact that the strategy analyzer correctly accounts for a split that occurred, while the live strategy (historical performance) does not. I have deleted the historical data both in the historical data manager and file system and still this persists.

    The live strategy does see the split, but for some reason it seems to see it late and therefore makes a bunch of trades based on what it perceives as a temporary significant drop in stock price (reverse split). I should mention that all of these strategies have been running for months and have occassionaly disabled/enabled for backups, maint, etc...

    I did start a new live strategy instance of this exact same strategy/parameters and it did not suffer from the same problem with the split when I look at its historical performance.

    So I am wondering if NT stores separate historical data for different instances of live strategies. This doesn't make sense to me, but I can't think of why I would be seeing this behavior.

    Any help would be appreciated.

    #2
    Just for clarification, the live strategies with the problem actually take into account the stock split on all days except for the actual day of the split. This is why for a reverse split the price appears to drop significantly for one day and on that day many erroneous trades are made. But then it also screws up the SMA calcs for future days since they take into account this split day.

    Comment


      #3
      Hello joesandyego,

      Thank you for your post.

      Since you mention Splits are you only running your strategies on stocks?

      Additionally, who are you connected to, the Splits may not be updating intraday, but the historical backtest is now taking the splits into account.

      Please see the following section - Understanding Splits and Dividends
      CameronNinjaTrader Customer Service

      Comment


        #4
        Yes. I only use stocks/ETFs and indexes. I am using IQFeed 1 minute bars. I have used splits successfully in the past.

        Again, the strategies treat the split correctly in all instances except in the historical performance calc of a long running strategy (right click a live strategy and select Strategy Performance > Historical) .

        If NT does not store separate historical data for live strategies, then maybe does NT somehow store unique parameters that are associated with a live strategy? And one of those parameters relates to splits and somehow it has the wrong split date. That seems like the only way to explain it. In that case, if I misentered the split date initially (not sure if I did) then maybe the strategy has the wrong date associated with it.

        I'm grasping for straws, clearly.

        Comment


          #5
          joesandyego,

          Thank you for the information.

          Since IQFeed does not update the Splits for intraday data this is where you are seeing this issue.

          I suggest contacting IQFeed to suggest that they offer this, and I will send a note to our Development Team as a suggestion.

          Once I have received a response from our Development Team I will provide you with a suggestion ID#.
          CameronNinjaTrader Customer Service

          Comment


            #6
            Hi Cameron,

            I would like to make sure that I really understand what you are saying and so I need to walk through a few scenarios with you. Can you please fill in the blanks? What you are saying does not make sense to me nor does it reflect the behavior that I have seen up until the point that I noticed this problem.

            As a setup, let's assume that stock AA reverse splits 1:2 on Tues, May 29 so that May 30 will be the first day that opens with the new split price. The stock is at $10 on May 29 close. I have "Adjust for splits" set in NT Options>Data tab. I enter the reverse split amount and day into the instrument manager 1 week before the split happens. My strategy XX, for the sake of this example, closes the position if the stock price increases or decreases more than 10% in a day. It also always closes a position and opens a new position at 11 AM every day so that we can see the stock price in the Historical Performance tab every day.

            1) I start strategy XX on Jan 1 with 300 days of historical data. I have occassionally disabled it and enabled it for backups, etc....
            May 30 12 PM : Realtime - What is the stock price? $10 or $20? Did my strategy close the position due to it mishandling the split?
            May 30 12 PM : Right Click on strategy and select Historical Performance. Would I see that the strategy closed the position due to it mishandling the split??

            May 31 12 PM : Realtime - What is the stock price? $10 or $20?
            May 31 12 PM : Right Click on strategy and select Historical Performance. Would I see that the strategy closed the position due to it mishandling the split on May 30? What would the stock price be on May 29, 30, 31 according the trades table?

            2) I start the exact same strategy, now called YY, on Jun 1 with 300 days of historical data.
            Right Click on strategy and select Historical Performance. Would I see that the strategy closed the position on May 30 due to it mishandling the split? What would the stock price be on May 29, 30, 31 according the trades table?

            Sorry for the detail. But I really can't figure out how the behavior that I am seeing is as expected due to IQFeed not providing split adjusted data since I manually enter in the split into the instrument manager and select "Adjust for splits" in NT.

            As always, I am hopeful that I have done something wrong that can be easily solved.

            Best.

            Comment


              #7
              1) I start strategy XX on Jan 1 with 300 days of historical data. I have occassionally disabled it and enabled it for backups, etc....
              May 30 12 PM : Realtime - What is the stock price? $10 or $20? Did my strategy close the position due to it mishandling the split?
              May 30 12 PM : Right Click on strategy and select Historical Performance. Would I see that the strategy closed the position due to it mishandling the split??
              Splits adjust the data behind the date that the split occurred so that data loaded is normalized. This would only occur after a reload of historical data request. If you never reloaded data the strategy should see the last bar the strategy see's is 20 and the new price commin in is 10. Triggered your logic.

              If you know a split is coming up you would have to know this and disable the strategy and right click->reloah historical data after putting in the split data so the split data takes effect. Then make sure the char tlooks good before you then reenable.

              Now on re-enable the last bar the strategy sees on 29th is 10 dollars and the new bar data coming in now is also 10 dollars. No problems.

              On our second question that answer is no it would be fine.

              I think your understanding is just flip flopped as split adjusts historical, not live.

              -Brett

              Comment


                #8
                Thanks. Yes. Sorry , I now see how I reversed the order of the split in my example. I think that my take away is to reload historical data occassionally and especially on special events such as this.

                This was very helpful.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by knighty6508, Today, 01:20 AM
                0 responses
                5 views
                0 likes
                Last Post knighty6508  
                Started by knighty6508, Today, 01:17 AM
                0 responses
                6 views
                0 likes
                Last Post knighty6508  
                Started by tierraany, Today, 01:06 AM
                0 responses
                4 views
                0 likes
                Last Post tierraany  
                Started by Wilmarobyi, Today, 12:48 AM
                0 responses
                3 views
                0 likes
                Last Post Wilmarobyi  
                Started by BackToTheFutures, 08-17-2021, 03:15 PM
                8 responses
                732 views
                0 likes
                Last Post joehanus  
                Working...
                X