Announcement

Collapse
No announcement yet.

100 stock C# sample project here

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

  • 100 stock C# sample project here

    Hi Folks,

    I created this little C# project to see if I would have any troubles pulling down streaming 1 minute bars for 100 stocks simultaneously. So far, I am having no problems. The code sends 100 RequestHistory calls without waiting for any of the calls to return. It then populates a grid with the OHLCV and time as each OnBarReceived or OnBarChanged comes in.

    I am running it right now (have been for about 10 minutes now) and it is humming away nicely. It is lunchtime, so the stream coming in is going to be slower than at the open. I'll have to try it then as well. Currently the program is consuming about an average of 12% of my CPU time (on an Athlon 2800). I have hit peaks of 53% so far.

    BTW, this is a single threaded app, so the grid redraws are occuring interleaved with the reception of the bars. With a batched grid update we could probably squeeze a little more performance out of it, but it seems to be working well enough for this test so far.

    BTW, if you are going to test performance, be sure to do it on a "Release" build.

    Project files attached...

    Cheers... George
    Attached Files

  • #2
    Thanks for posting the example. Where did the Interop.IESignal.dll file come from?

    Regards,

    Justin

    Comment


    • #3
      The Interop.IESignal.dll was built from the eSignal COM object that was selected when you right-click on the References section in the C# Solution (selecting Add References... and then picking the COM tab). Visual Studio .NET 2003 takes care of building the COM wrapper logic that correctly manages the COM calls, events and marshals the data from to and from either your C# or Visual Basic.NET or Visual J#, etc. programs.

      Side Note:

      Unfortunately, it's an extra layer of software that has to be there in order for the managed world of the .NET Common Language Runtime (CLR) to be able to interface with the unmanaged world of COM. We're dealing with real-time data here so it's a tradeoff between having a rich programming environment that's easier on the developer vs. the higher latency times that will result from its use.

      Comment


      • #4
        George,

        Thank you for your sample code and continued support.

        Robi

        Comment


        • #5
          not working

          Hi,

          I am very new to DeskTop API. I tried running this program. I gave my username and click start. Nothing is happening. I put break pionts in esignal_OnBarsChanged and esignal_OnBarsReceived but it never goes there.

          I have tried manythings but no luck. Please help me in this regard.

          -ebedmelech

          Comment

          Working...
          X