Announcement

Collapse
No announcement yet.

C++ sample code hang out

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

  • C++ sample code hang out

    I am a new user for the ActiveX, I just downloaded the C++ samples and compile it. It works, but after get the real time quote for about 5 minutes, it become vary slow and my CPU is 100%, it become useless since there is delay between the data I got and real data by minutes.

    I have a 1.8GHz P4 XP, 512 MB memory but I also run Matlab at the same time.

    I tried other PC without Matlab, it is the same probelm.

    Please help me out here, I read the old forum there is a guy use a slow PC had similar problem, but my is not the slow at all.
    Peter

  • #2
    This could be a variety of causes, including the number of symbols that you are using, the activity of the symbols, the interval, what other applications you are using, etc.

    The API does take up a significant amount of resources since it makes out of process calls, but the exact cause of your delays could be any number of things.

    Comment


    • #3
      C++ sample code hang out

      I added 512MB memory but it does not help, should I try a faster CPU like 3.4GHz one?

      Do yo have C++ version which use less resource?

      Thanks

      Peter
      Peter

      Comment


      • #4
        We only offer our Desktop API to our retail customers. It seems to me it's more how the program works and/or what it is doing that could be causing the problem, especially if there are other applications running. It could be that the COM handler in the Windows OS is what is spiking the CPU usage. I would verify your code and ensure that you are waiting for the OnChanged() event to retrieve your data.

        How many symbols are you tracking? At what interval?

        If you are streaming more than around 200 symbols, I would expect these problems.

        Comment


        • #5
          I only checking the QQQQ, one symbol but at the tick level.

          I notice that if I run the code after hour(later than 1:15PM PST) the code works fine since every minutes we have about 100 trades. In normal hours there are about 300-1000 trades a minutes.

          I did not change any thing in the code, just use the VC++ 6.0 to compile it. I download from the website.

          I guess there is buffer size too small which save the input data, only wild guess.

          In normal time it can run about 300-500 ticks and then it starts slowing down.


          Peter
          Peter

          Comment


          • #6
            Well, I know the API works for the QQQQs because I know of an application that was commercially developed with it and examining the QQQQs.

            A faster CPU could help, but can't say for sure.

            Comment


            • #7
              In this case, what is my option?

              I really need to API working on real time for my day trading.

              I shut down all the other applications, and just run this API it is still maximize the CPU in about two to five minutes.

              I use XP, should I try the Win2000?
              Peter

              Comment


              • #8
                FWIW, my app watches time and sales for ES, NQ, and YM simulataneously all day long with relatively little CPU utilization. I have also at time changed to SPY, QQQQ, and DIA with no difference really. I run XP on an Athlon 2500 with 1 meg RAM. Depending on what you are doing, your machine sound powerful enough in general, especially to follow just the QQQQs.

                There may be something in the app itself that is causing the problem. One known issue with dealing with time and sales via the API is that a call to retrieve a single tick is relatively slow. Not a problem when you just want to retrieve the latest ticks. However if your app pulls every historical tick out of the API each time a new tick comes in (as opposed to caching the previous ticks if you need them), then your app will indeed come to a grinding halt as the ticks pile in.

                A function to retrieve a batch of ticks could significantly speed this up. That's on my wish list for the future.

                Cheers... George

                Comment


                • #9
                  Accomodating for a batch of ticks is tough because of the way they are stored. We are actually changing the record format for ticks, so your wish may come true - eventually.

                  Comment


                  • #10
                    Cool. I'm patient.

                    Comment


                    • #11
                      I only get the sales data, like last, lastSize etc, not even the time yet. I will try to borrow a fastest PC to see if I get any improvement. Does the VB code is even slower?

                      Thanks a lot.

                      Peter
                      Peter

                      Comment


                      • #12
                        The commercially developed application used VB and worked fine, so I comb through your code or maybe use a symbol that is not so active to see if you have the same problems.

                        Comment


                        • #13
                          GenSpoo's analysis might be as good as it gets.
                          There should be no problem on any machine that runs XP to get QQQQ T&S. There are only 2-3 ticks per second. If you start pulling data in the middle of a session, it will generally get all the historic ticks first (a few hundred at a time), then the real time ticks as they become available. So your app could be slow in the beginning, and get a relief once you're past the historic ticks. NOT the other way around! If anything slows your machine the further you go, neither the machine nor the feed are likely culprits.
                          Suggestion: Don't do anything with the ticks, just receive them. If that does not help, cut out the historic ticks. Get nothing but the realtime ticks. Your machine should be idling at 99%. Now add one functionality at a time. Good luck.

                          Comment


                          • #14
                            Great suggestions, Roland. Thanks for the input.

                            Comment


                            • #15
                              I tried VB code and it works just fine, no problem for QQQQ. I will start from there.

                              Thanks for all your help.

                              Peter
                              Peter

                              Comment

                              Working...
                              X