Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical trades of Time and Sales

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

    Historical trades of Time and Sales

    Hello Support --

    I'm developing a script which shows me Time and Sales trades filtered by volume size, which happens two or five hours ago. Well, I click my custom button and my custom window shows me current trades and for example 20 or 30 past trades filtered by volume size.

    For current trades I used OnMarketData() method. Where can I get past trades to filter them and show them in my custom window.

    Regards.

    #2
    Hello,

    Thank you for the question.

    I wanted to check, if this is a strategy in question here, you could access the TradePerformace collection to retrieve prior trades the strategy has made: http://ninjatrader.com/support/helpG...erformance.htm

    For other items such as indicators or if you wanted a total collection of orders, there is no documented way to get all of the trades although you may be able to access the data you need in unsupported ways.

    This is an older post but shows the syntax needed to access the Account in which you could potentially poke around and find the data you are looking for in that case: http://ninjatrader.com/support/forum...78&postcount=2
    With any undocumented code please ensure to test the script you are using for accuracy as these undocumented items can potentially give difference results than you are expecting.


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

    Comment


      #3
      Jesse --

      thank you for you reply.

      my question is not about my trades, it is about all trades in a market I'm developing a script like NT Time and Sale tool, which shows me the historical trades.

      The problem of NT T&S tool is that it's prints are deleted when I close it. I need to see historical trades each time when I open my T&S.

      Now I use ADO.NET clasess and methods to build virtual DataTable and keep the trades there. But it does not work when I shout downt NT7. The other problem is that I need to see more then 30 innstruments.

      So, I asked are there any ways to get data of historical trades, to download them from something like NT database or any other files. When I use market replay conection NT7 gives me T&S trade prints, so it takes them from somewhere.

      Could you please tell me where can I get historical data of T&S tool

      Regards

      Comment


        #4
        Hello,

        Thank you for the clarification.

        In this case you would need to devise a way to store the data you are using to file and re load it when needed. There would be no historical access for data you are pulling out of OnMarketData. You can do as you currently are to get the data but you would need to store that data on exit using the OnTermination overload, and reload that data on startup likely using the OnStartUp overload if you want to make it persistent being that this is not a historical series in the platform by default.

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

        Comment


          #5
          Jesse --

          thank you for your reply.

          NT7 is able to build a chart of tick data/ The volume indicator buids tick volume chart. I tried it. It works.
          So, the platform gets historical tick data from somewhere to build tick chart of price and volume.

          My question is where from does the platform take tick data?

          Just tell me the files which the platform use to build tick charts or give me the methods which the platform to get tick data. All other thing I make myself.

          Regards.

          Comment


            #6
            Hello,

            Thank you for the reply.

            There would be no need to create your own historical logic here, your script already has access to historical data just like any indicator or strategy you may use in the platform. You are just using a Realtime only method which does not work historically, this is why you do not see anything after restarting the script and would be expected.

            OnMarketData is strictly a realtime method meaning this only has importance in realtime, if you needed historical values you can either use OnBarUpdate to access the Close values for historical bars or you can Store the data you are getting in OnMarketData in a collection and when the script exits save that collection to file, when the script starts read that collection from file.

            There would be no need to try and access the actual historical data files ever because these are already loaded in the platform. The actual files for the data would be of no use anyway as they are not in a human readable format that you could parse into valid data.

            If the Volume indicator is accessing the historical data as you intend to, I would suggest you review the code used for the Volume indicator to better understand how to access that historical data.


            Please let me know if I may be of additional assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by atrader, Today, 09:29 AM
            0 responses
            5 views
            0 likes
            Last Post atrader
            by atrader
             
            Started by nailui, Today, 07:26 AM
            1 response
            28 views
            0 likes
            Last Post NinjaTrader_Spencer  
            Started by chartchartchart, Today, 08:08 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Emily  
            Started by andreslazor7, Today, 08:08 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by FatCanary, Today, 08:09 AM
            2 responses
            10 views
            0 likes
            Last Post FatCanary  
            Working...
            X