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

Historical Bid/Ask Data Series during Backtesting

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

    #16
    Hello kimsteve,

    You can use the playback connection and select historical data in the controller if you wanted to playback historical data, you otherwise need to compare likewise tests. Comparing historical data vs realtime data is not the same type of test. Please make sure you are reviewing the links that I have provided in previous posts that covers common discrepancies between testing modes.

    If your script works as you expect in realtime then you will very likely need to only use realtime testing modes. In that case you can use a live data connection or playback with playback data selected and not use historical data.
    JesseNinjaTrader Customer Service

    Comment


      #17
      Hi Jesse,

      I have checked the link you've provided previously, thank you for the link. Using historical data while running playback would be counterproductive as it would be deviating further from live performances. Please make sure you are reviewing my previous posts regarding my concerns. If my script works in realtime, there is more of a reason to backtest to see if the performance would hold in previous market conditions. Using playback to test for years worth of data is very inconvenient. Is there a way to use market replay data in backtesting? If not, backtesting remains obsolete as it doesn't indicate performance of the strategy remotely closely to what would be seen in real time.

      Thank you.

      Comment


        #18
        Hello kimsteve,

        There are many cases where a backtest will not match realtime for various reasons, that is specifically documented in the help guide link that I had previously provided. In this case the way your logic is intended to work in realtime will not work the same with historical data so the only option would be to use recorded live data if you wanted to test previous dates and have a similar result. Using historical data will otherwise produce the result you have observed. In some cases what you make cannot be backtested using historical data and that is normal, it depends on how you develop your script and its requirements. The links I provided go over common discrepancies between the different types of data that you can test on.
        JesseNinjaTrader Customer Service

        Comment


          #19
          Thanks for your help Jesse. It seems that my initial claim was correct: strategies using historical Ask, Bid, and Last series cannot be tested accurately in backtesting, as the events for these series are sorted by timestamp, which is not the case for realtime/market replay data. Hopefully next time this question is asked by other members, you can keep the conversation short by outlining the differences we observed here. I hope you read this in detail and let me know if you agree with the conclusion; your responses have not been addressing the specific questions I asked and slightly disrespectful from the beginning.

          Could we submit a feature request to enable OnMarketData Ask and Bid events to be enabled in TickReplay during backtesting? I think this would be a crucial feature in backtesting strategies that use these data series, and would make backtesting a lot more useful.

          Thank you.

          Comment


            #20
            Hello kimsteve,

            To use OnMarketData in historical you need to develop the script to use TickReplay however that again is not going to directly match realtime. That will provide the ask/bid at the time of the last event only. For what you are trying to do you will need to forward test using a realtime mode.
            JesseNinjaTrader Customer Service

            Comment


              #21
              Now it is blatantly clear to me that you have not been reading my responses. I am aware that TickReplay only provides the ask/bid at the time of the last event only, hence the feature request to enable MarketDataType.Ask and MarketDataType.Bid events to be provided as well.

              I hope the request can be made.

              Comment


                #22
                Hello kimsteve,

                TickReplay does not have the ability to have the full ask and bid series so that part would not be possible based on how that is designed, Last data is used which contains a single ask/bid price. TickReplay is not intended to offer full ask or bid series.

                The platform has the capacity to add historical ask and bid data, if you want to have a full ask and bid historical series you need to use AddDataSeries and have a data provider that offers historical ask and bid data.

                In either case your logic needs to work identically between historical and realtime to see an identical result, if any part of processing works differently we wouldn't expect an identical result. Based on the information you have provided you would need to use a realtime testing mode as you mentioned that is where the script works as you expect based on how you designed your logic.

                If you want to make any feature requests you can post your requests to the suggestions and feedback sub forums.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by naanku, Today, 07:25 PM
                0 responses
                7 views
                0 likes
                Last Post naanku
                by naanku
                 
                Started by milfocs, Today, 07:23 PM
                0 responses
                5 views
                0 likes
                Last Post milfocs
                by milfocs
                 
                Started by PaulMohn, Today, 06:59 PM
                0 responses
                7 views
                0 likes
                Last Post PaulMohn  
                Started by bortz, 11-06-2023, 08:04 AM
                48 responses
                1,755 views
                0 likes
                Last Post carnitron  
                Started by Jonker, 04-27-2024, 01:19 PM
                3 responses
                24 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X