Jump to content
Sign in to follow this  
Ynor

.Net C# Lightstreamer Demo

Recommended Posts

Hello,

I am trying to implement a streaming service to receive live price data using Lightstreamer, but I am having trouble wrapping my head around the code implementation.

First thing I want to say is that I have gone through the GainCapital documentation and the Lighstreamer documentation and beginner examples. I also downloaded a sample C# demo of the lightstreamer implementation and went through the code.

I am a junior developer and I have no problem creating the other post requests to https://ciapi.cityindex.com/tradingapi/ endpoint  for authentication. But I am not sure how to implement this specific streaming service in C#.

I am sure there must be many implementations of this service already created, even internally-- so I wanted to know how we could get access to a demo implementation of the gain capital streaming service?

 

Thank you in advance.

 

Share this post


Link to post

Hello Ynor,

Our internal code implementations are not written in a way that they can be given out.

What could be helpful to you are the example code projects on the Lightstreamer site at: https://demos.lightstreamer.com/?p=lightstreamer&t=client&sclientmicrosoft=dotnet. These code examples should provide you with something to work from in figuring out your C# .NET code..

Kind Regards, PM

Share this post


Link to post

I already have those projects downloaded, I can see how it works but I don't understand from the gain capital side.

Do you know if this a service that can be purchased?

Share this post


Link to post

Hi Ynor,

Sadly no, we don't offer that service.

In terms of the example code, how Lightstreamer works is that you can use their API/calls as shown and just replace the server address where mentioned in the code with ours: https://push.cityindex.com/.

Similarly, where it mentions an adapter you would replace that with "STREAMINGALL", which is the name of our LS adapter. Then you can subscribe to the streams provided in this adapter:

  • PRICES
  • NEWSHEADLINES
  • CLIENTACCOUNTMARGIN
  • TRADEMARGIN
  • ORDERS
  • QUOTES

Kind Regards, PM

Share this post


Link to post

 Hello,

 

 I was able to get a demo working using the Lightstreamer quickstart C# example.

 

I am working with Lightstreamer.DotNetStandard.Client (5.0.5)  and  I  instantiated and populated a LightstreamerClient object so it looks like this:clientObject.PNG.162e9893b7b45337f67c272d716ef154.PNG 

The value I used for the password was the session token I got from https://ciapi.cityindex.com/TradingAPI/session (as the documentation states) and the User is the username that was given to me for the demo account.

 

When I try run the Connect() method on my LightstreamerClient object, this is what I get:

image.png.c4183933868ae52c8bfa210feb3d612f.png

I can't find documentation for this error anywhere. Do you know what I am doing wrong?

Thanks in advance,

 

Rony

Share this post


Link to post

Hello,

I have created a thread in the Lightstreamer forum for this.

I have also been able to get more logging output from the connection: 

image.thumb.png.1fbcd459284fc43203226e98802d97ab.png

 

Is there anything here that you can identify?

 

Thanks in advance,

 

Rony

Share this post


Link to post

Hi Ynor,

It looks as though it is having trouble connecting. 

Just to check, you have downloaded and are using the correct version of the Client SDK to match the version of Lightstreamer Server (v7.0.1.) we are using? There have been incompatibility problems before when the wrong client version was used.

Kind Regards, PM

Share this post


Link to post

Rony

Thanks very much for taking the time to post this. After reading your posting, I was finally able to get this to work.

Cheers

Chris.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×