Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Streaming out Tick data from NT

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

    Streaming out Tick data from NT

    Hi.

    I have written a standalone app that summarizes and analyzes historical emini S&P 500 tick data, and generate buy and sell signals on the fly. I have spent a bit more than eight months on that - hard work, but I am extremely pleased with the results. And now I want to integrate the app with a trading platform such as NT. The idea is to test the app and the trading platform together against live data first; and then to go live after that, depending on the results. My app then becomes part of a fully automated system - precisely what I had in mind when I started this.


    The app is quite complex, and I doubt if I can ever rewrite that in NinjaScript, though that would be the ideal solution. My best hope is to get the NT to stream out the tick data to my app, and for NT to pick up the buy/sell signals generated. The OIF feature of NT, is good enough as a mechanism for that. But I am not sure whether it is possible to stream out tick data as a csv file from within NT. If it can be done, then that's it. I will go NT, learn C#, and then, maybe, become a successful trader.

    If anyone has done something like this before, I'd like to hear from him/her.

    TIA

    #2
    Do you want real-time tick by tick data fed directly into your own application or do you only want to write out a file?
    RayNinjaTrader Customer Service

    Comment


      #3
      Depending on what technology you used for your app, I would think the simplest solution would be to make a simple NinjaScript strategy that simply forwards the tick data to your app on every OnBarUpdate event and in turn takes any buy/sell signals generated and submits them through NT in the normal way.

      As NinjaScript strategies are really compiled C# .NET classes you can do pretty much anything in them, including making use of .NET's extensive interoperability functionality.

      If your app supports communication protocols such as COM this should be pretty straightforward.

      Comment


        #4
        Originally posted by NinjaTrader_Ray View Post
        Do you want real-time tick by tick data fed directly into your own application or do you only want to write out a file?
        Ray,

        Thank you very much for your reply.

        I would prefer to a file, but one that is configured as a named pipe. In which case, the filename would be something like this: \\.\pipe\NTTickData. Frankly, I have had very little experience with this technique, but it looks simple enough to me. If it's not particularly difficult to set up in NT, then I can try hooking that up to my trading app, and I will just have to see how that works out.



        Comment


          #5
          Hi,

          Yes, I've done this before. I either write ticks to a file or stream them to my app within a NinjaScript indicator or strategy. The app then reconnects to NT via the Automated Trading Interface on a COM connection for placing and working orders. If its just a file you want then use the StreamWriter class in your C# / NinjaScript.


          Gumphrie

          Comment


            #6
            Gumphrie,

            Your reply is extremely encouraging and helpful. It means all that time I spent building the app is not going to waste. Thanks heaps.

            By the way, which prog language did you use to write your app? I wrote mine in SAS (Statistical Analysis System). It does have a number of methods to communicate with non-SAS apps; except that I haven't had the chance to use any of them yet. I think the part that bothers me more is the C# language. I am even more ignorant there.

            Cheers.
            Last edited by maskiepop; 07-16-2007, 09:01 PM.

            Comment


              #7
              Originally posted by maskiepop View Post
              Gumphrie,

              Your reply is extremely encouraging and helpful. It means all that time I spent building the app is not going to waste. Thanks heaps.

              By the way, which prog language did you use to write your app? I wrote mine in SAS (Statistical Analysis System). It does have a number of methods to communicate with non-SAS apps; except that I haven't had the chance to use any of them yet. I think the part that bothers me more is the C# language. I am even more ignorant there.

              Cheers.
              I wrote mine in C++. Can you add external dll references in SAS? That will probably be a min requirement to talk to other apps.

              The only C# you need to know is how is the basics for chart indicators.
              Last edited by Gumphrie; 07-17-2007, 01:08 AM.

              Comment


                #8
                Hi Maskiepop,

                May I ask you : where do you purchase E-mini S&P500 tick data to feed your statistical analysis ?

                Gérard

                Comment


                  #9
                  Originally posted by grd974 View Post
                  Hi Maskiepop,

                  May I ask you : where do you purchase E-mini S&P500 tick data to feed your statistical analysis ?

                  Gérard
                  It's free, from www.opentick.com. The quality may not be very good, though. Sometimes there are gaps in a day's trade. Some days might be missing.

                  If you really want good quality data, and want to pay for it, you may want to contact CME (www.cme.com), the exchange itself. There are others as well, but I thought CME is probably your best bet.

                  Comment


                    #10
                    Originally posted by NinjaTrader_Ray View Post
                    Do you want real-time tick by tick data fed directly into your own application or do you only want to write out a file?
                    Ray,

                    I thought I needed to describe more precisely how I want NT to interface with my app. The link below describes the feature I want to see in NT and would allow me to interface my trading app with it, seamlessly.

                    http://codeidol.com/csharp/csharpckbk2/Networking/Using-Named-Pipes-to-Communicate/#csharpckbk2-CHP-16-EX-3

                    It might even expand the automation capabilities of NT beyond what it is now.

                    Would you like to take a look and tell me that this won't cause NT to hiccup. I mean NT should be able to operate on its own, as before, even if I do not bring up my app. That sort of thing.

                    Let me know what you think.


                    TIA

                    Comment


                      #11
                      NT would work fine. Please keep in mind, this approach is outside of the scope of what we officially provide support for.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        Do you have to communicate accross a network? Will your application be sitting on a different machine to NT?

                        I have my app on the same machine as NT which means I can just use messaging or "WM_COPY" events to communicate which is a lot simpler than sockets and pipes, etc.. Also remember you will have to communicate back to NT to place and work orders on a COM or dll connection (unless you want to use a file or email based interface), I'm not sure how that would work accross a network as I haven't tried.

                        Comment


                          #13
                          Hi Ray,

                          I have an issue about tick data coming out from NT : I wish I could access to Last Price Data Series from Market Analyzer window but I am afraid that this approach could be "outside of the scope of what you officially provide support for"; so if it's the case, just let me know.

                          Comment


                            #14
                            Yes, this is outside the scope of support. In NT 6.5, we will have support for market data handlers which allow you to code against all incoming market data events directly in indicators and strategies.
                            RayNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by Gumphrie View Post
                              Do you have to communicate accross a network? Will your application be sitting on a different machine to NT?

                              I have my app on the same machine as NT which means I can just use messaging or "WM_COPY" events to communicate which is a lot simpler than sockets and pipes, etc.. Also remember you will have to communicate back to NT to place and work orders on a COM or dll connection (unless you want to use a file or email based interface), I'm not sure how that would work accross a network as I haven't tried.
                              My SAS app will have to be on the same machine with this particular implementation of the named pipe. And if I am not mistaken, this particular IPC uses shared memory when on a local machine, is bi-directional, etc.

                              The reason I want to use this interface is that I don't want to mess around with C# every time I need to modify or experiment with a new trading strategy. SAS is a very good tool for analyzing large amounts of data with very little coding, although I suspect proggies tend not to like the language. Once this feature is in, then all NT will be doing for me is pass the tick data to my app, and receive the buy /sell signals from it. Everything else is done outside, including the OHLC summary.

                              Gumphrie, can you point me to some good material on the web regarding C# messaging. I'd appreciate that.

                              TIA

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Segwin, 05-07-2018, 02:15 PM
                              14 responses
                              1,789 views
                              0 likes
                              Last Post aligator  
                              Started by Jimmyk, 01-26-2018, 05:19 AM
                              6 responses
                              837 views
                              0 likes
                              Last Post emuns
                              by emuns
                               
                              Started by jxs_xrj, 01-12-2020, 09:49 AM
                              6 responses
                              3,294 views
                              1 like
                              Last Post jgualdronc  
                              Started by Touch-Ups, Today, 10:36 AM
                              0 responses
                              13 views
                              0 likes
                              Last Post Touch-Ups  
                              Started by geddyisodin, 04-25-2024, 05:20 AM
                              11 responses
                              63 views
                              0 likes
                              Last Post halgo_boulder  
                              Working...
                              X