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

Accessing market replay data

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

    Accessing market replay data

    I need to gather some statistics from market replay data. The only way I see is to make a strategy and run it with market replay and caclulate statistics on each tick. But it is extremely slow and inappropriate for me.

    I wonder, if some possibility to read market data with add-on. Is there any API for that? Or maybe you can provide me the market replay file format. In short, any way to get access to market replay data.....

    #2
    Hello,

    Thank you for the post.

    The Replay data specifically can only be Played back, there are no other options to reiterate over that type of data otherwise.

    You can iterate over Historical data in a loop but this is not the same as playing back the recorded replay data as it is only historical data. Also for placing trades or other strategy specific calculations, the strategy would physically need to run for that to occur.

    In the case you need to gather statistic information from a strategies trades in Playback, the only option to speed this process up would be to use the faster speeds of playback and allow the strategy to trade.



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Bad news.
      Maybe I can read market data file directly?

      Comment


        #4
        Hello,

        The format of the reply data would not be something I could detail, this is an internal format that development has created. This data is processed specifically by NinjaTrader and would not be in a format that is able to be read outside of the platform.

        Unfortunately, the only way to playback Replay data would be to use the Playback connection.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Maybe I can export somehow market replay data to any understandable format (for ex. CSV) ? Does NT have ability to export data?

          Comment


            #6
            Hello,

            Yes, there is the ability to export Historical data using the Historical data manager but this would not be the same data as Replay data.

            You can transfer replay data from one pc to another but it would require NinjaTrader to read it.

            The only way I could see you being able to export the replay data specifically would be if you made a script that collects this data while you are playing in replay and stores it in a format you can use.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              I still insist on my idea with getting market data. And I achieved some results. As it seems there are simple ways to get market data:

              Code:
              var aInst = Instrument.GetInstrument("EURUSD");
              
              MarketReplay.DumpMarketData(aInst, new DateTime(2017, 6, 19), new DateTime(2017, 6, 20),@"C:\Temp\MR\test1.csv");
              MarketReplay.DumpMarketDepth(aInst, new DateTime(2017, 6, 19), new DateTime(2017, 6, 20),@"C:\Temp\MR\test2.csv");
              This code dumps (successfully!) all the market replay data to CSV-file
              I want to simplify the process and omit parsing CSV file, so I tried this method:
              Code:
                                  var aInst = Instrument.GetInstrument("EURUSD");
                                  var aMr = new MarketReplay(aInst, new DateTime(2017, 6, 19));
                                  aMr.Start();
                                  while (aMr.MoveNext())
                                  {
              
                                  }
              Since there is no any documentation about MarketData class I made this code, driven by my own logic. But it does not work. I see that MarketReplay instance initialized successfully, but MoveNext does not produce any valid data.

              I very much ask you to contact the developers and send me their response. I see that the task of obtaining market data can be easily solved (although it is not documented), just need a little help

              Comment


                #8
                Hello, rfsettling.

                I tried dumping NQ data with the exact code, but it did not dump. Curious if you have any other info I could use. Thanks

                Comment


                  #9
                  You can check NRDToCSV GitHub repository in case if you need to convert NRD files regularly:

                  nrd to csv file conversion

                  Comment


                    #10
                    Your conversation is really helpful
                    It reminds me of a position I were in sometimes ago
                    thanks for the info though!

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by philmg, Today, 01:17 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post philmg
                    by philmg
                     
                    Started by cre8able, Today, 01:01 PM
                    1 response
                    4 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by manitshah915, Today, 12:59 PM
                    1 response
                    3 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Started by ursavent, Today, 12:54 PM
                    1 response
                    4 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by Mizzouman1, Today, 07:35 AM
                    3 responses
                    17 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Working...
                    X