Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exporting 'top of book' data?

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

    Exporting 'top of book' data?

    --I'm looking to export data from NT into a csv file.

    --Target format:
    Time, Last price, Last size, Bid price, Bid size, Offer price, Offer size

    --All of the data has been recorded in market replay and some of it is in chart data files, too.

    What is the best way to extract this data in the format above so that the order and quote series are aligned in the order that they were actually recorded?

    #2
    see attachment for example of top of book format. ms periodicity time stamp hidden, but you get the idea.
    Attached Files

    Comment


      #3
      Hello bluelou,

      Writing to a cvs file is not supported by NinjaTrader support to do, however, I am providing a link to a thread where community members have gotten this working.
      http://ninjatrader.com/support/forum...t=36938&page=7

      As far as the order, if you are writing all of the OnMarketData events to the file these events are triggered in the order they are received. So as long as only one script is writing to the file and you write them as they are received they will be in order.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Chelsea,
        The format isn't really important. What I'm asking is how do I extract top of book data from NT's database, say, using Print() statements for instance.

        The only thing I can think of as a possibility is creating a log file from OnMarketData() with Market Replay. That would be slow, but it might work. Any other ideas?



        Originally posted by NinjaTrader_ChelseaB View Post
        Hello bluelou,

        Writing to a cvs file is not supported by NinjaTrader support to do, however, I am providing a link to a thread where community members have gotten this working.
        http://ninjatrader.com/support/forum...t=36938&page=7

        As far as the order, if you are writing all of the OnMarketData events to the file these events are triggered in the order they are received. So as long as only one script is writing to the file and you write them as they are received they will be in order.

        Comment


          #5
          Hi bluelou,

          I need you to clarify extract top of book data from NT's database.

          The NinjaTrader database contains Atm Strategies, execution and order history, Instrument settings and instrument lists. However, I don't think it contains what you are looking for.

          Are you talking about historical tick data? (This is kept in individual historical data files on your PC)

          Are you talking about level 2 data that is received in real time?

          What is the top level? Are you talking about the highest price hit in level 2 information in real-time? (This you would see in the Level II window from File -> New -> Level II...)
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Chelsea,
            This is what I mean by top of book (aka Level 1 in some markets):
            Time, Last price, Last size, Bid price, Bid size, Offer price, Offer size

            I don't need full depth like you'd see in a Level II window.

            My question is how do I "Print()" these fields mentioned above?

            Thx,
            Lou


            Originally posted by NinjaTrader_ChelseaB View Post
            Hi bluelou,

            I need you to clarify extract top of book data from NT's database.

            The NinjaTrader database contains Atm Strategies, execution and order history, Instrument settings and instrument lists. However, I don't think it contains what you are looking for.

            Are you talking about historical tick data? (This is kept in individual historical data files on your PC)

            Are you talking about level 2 data that is received in real time?

            What is the top level? Are you talking about the highest price hit in level 2 information in real-time? (This you would see in the Level II window from File -> New -> Level II...)

            Comment


              #7
              Hi Lou,

              These are market data events. You would print the market data event time or price etc.

              Below is a link to OnMarketData() in the help guide.
              http://ninjatrader.com/support/helpG...marketdata.htm
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                So, if I wanted to get this info from the NT database and this requires OnMarketData then the only way to do this would be with market replay. Is that correct or is there another way?

                Also, if I use OnMarketData am I assured that I will be able to print these events in the sequence they occurred?
                Last edited by bluelou; 08-26-2015, 10:28 AM.

                Comment


                  #9
                  Hi bluelou,

                  This data can be downloaded. (Not to the NinjaTrader database but to historical data files)
                  If you add a 1 tick last, 1 tick ask, and 1 tick bid series to your script this would basically give you the same data and you would print from OnBarUpdate().

                  The issue would be the order however. To have these events be in exactly the right order would mean you would want to print these from market replay.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Chelsea,
                    Yes, I kinda thought so. The events only make sense to me in the order they occurred so it sounds like print/log statements using OnMarketData during a Market Replay is the way to go. Just confirming that's what you're suggesting, right?


                    Originally posted by NinjaTrader_ChelseaB View Post
                    Hi bluelou,

                    This data can be downloaded. (Not to the NinjaTrader database but to historical data files)
                    If you add a 1 tick last, 1 tick ask, and 1 tick bid series to your script this would basically give you the same data and you would print from OnBarUpdate().

                    The issue would be the order however. To have these events be in exactly the right order would mean you would want to print these from market replay.

                    Comment


                      #11
                      Hello bluelou,

                      Yes, I agree simply because historical tick data is timestamped with second granularity and not millisecond granularity. So Market Replay would be slightly more accurate.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        okay, thx for your help.

                        BTW, I thought I read that NT8 will have millisecond time stamps. Is this correct? I haven't been following the updates.

                        Comment


                          #13
                          Hello bluelou,

                          That is correct. In NinjaScript if the data provider provides millisecond granularity then you will be able to access this millisecond granularity from a script in NT8.
                          Chelsea B.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by fx.practic, 10-15-2013, 12:53 AM
                          5 responses
                          5,404 views
                          0 likes
                          Last Post Bidder
                          by Bidder
                           
                          Started by Shai Samuel, 07-02-2022, 02:46 PM
                          4 responses
                          95 views
                          0 likes
                          Last Post Bidder
                          by Bidder
                           
                          Started by DJ888, Yesterday, 10:57 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by MacDad, 02-25-2024, 11:48 PM
                          7 responses
                          160 views
                          0 likes
                          Last Post loganjarosz123  
                          Started by Belfortbucks, Yesterday, 09:29 PM
                          0 responses
                          9 views
                          0 likes
                          Last Post Belfortbucks  
                          Working...
                          X