Jump to content

Search the Community

Showing results for tags 'lightstreamer'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Gain Capital API FAQ
    • General Questions and Discussion

Found 22 results

  1. I set up Lightstreamer's QuickStart and it worked fine. I then made the changes needed to connect to push.cityindex.com, including getting a session ID from https://ciapi.cityindex.com/TradingAPI. . I get a client listener onServerError with errorCode = 60 errorMessage = “License not valid for this Client version”. The explanation from LightStreamer is "That message means that the client in use is newer than the license installed on the server.To use that client with that server, assuming them are compatible, you need to change the server license." I am using c# using Dotnet Standard Client version 5.0.5. So, appears to be a licensing problem between Gain Capital Labs and Lightstreamer. Another user posted at http://faq.labs.gaincapital.com/topic/2039-lightstreamer/?tab=comments#comment-3692 suggest using V 4.0.0. Unfortunately, Lightstreamer documentation is not helpful because they have upgraded all their sample code to v 5.0.5. Can you provide some sample c# code to start a price stream under 4.0.0? Regards, Chuck
  2. I am a USA customer with an account through forex.com I am developing using .net c#. I'm doing fine with the REST API but I can't connect to the Gain Capital Lightstream server. I was able to connect to the Lightstream demo push server. However, when I try to connect to https://push.cityindex.com I get no response. Not an error; it just ignores me. The client remains in a disconnected state. Elsewhere on this forum, it was suggested that this might be due to using the wrong client software for the version of the server being run by Gain Capital. The Lightstreamer documentation site, under ".net" describes the Dotnet Standard Client version 5.0.5 which is what I was trying to use. The NuGet package manager has 7 versions of Lightstreamer.DotnetStandard.Client available from 4.0.0 to 5.0.5. It also has Dotnet Client available in 4 versions from 3.0.0 to 3.1.6640.22649. The differences in these versions are not trivial. Going from Standard 4.* to 5.* even has different using statements. Before I spend time getting even more frustrated trying different clients, would you please tell me what version of the server you are using and what version of which client package I should be using? Perhaps you could provide a c# sample, not a whole working application, but at least the usings, and the minimum statements to establish a connection and start a stream of prices for a couple currency pairs? I can get the session ID from REST API. Please?
  3. Hi, I am running into issues creating a Lightstreamer session. I have spent the last two days scouring the FAQs (yes, including the motown69 thread and several others), the Lightstreamer documents, and the GAIN Capital API documents for solutions to no avail. If someone (probably physicsman) could please help me out, I would be very grateful. Background: I am using a demo account for access to the REST API. My demo will not expire for another 27 days. I have installed and configured both Lightstreamer 7.1.1 and Lightstreamer 7.0.3 to my machine, to different TCL ports. I never have more than one server running at a time. I am sending requests via Postman. I have successfully logged in via the POST request format described in the GAIN Capital API documents. I have successfully retrieved a session token via the GET request format described in the GAIN Capital API documents. All attempts to create a Lightstreamer session that I describe moving forward are executed very soon after successfully retrieving a new session token, and using this session token that has just been retrieved. What I am doing: I do not start a Lightstreamer server on my machine beforehand, since I assume that is unnecessary, given the http://push.cityindex.com/ URI suggests that I would be using a GAIN Capital-hosted Lightstreamer server POST request to http://push.cityindex.com/lightstreamer/create_session.txt?LS_protocol=TLCP-2.2.0&LS_cid=mgQkwtwdysogQz2BJ4Ji kOj2Bg&LS_adapter_set=STREAMINGALL&LS_data_adapter=PRICES.PRICE.154297&LS_user={{userxname}}&LS_password={{sessionxtoken}} As you can see in the URI, I am using the following parameters: LS_protocol : TLCP-2.2.0 As per the Lightstreamer documents LS_cid : mgQkwtwdysogQz2BJ4Ji%20kOj2Bg As per the Lightstreamer documents LS_adapter_set : STREAMINGALL As per the GAIN Capital API documents LS_data_adapter : PRICES.PRICE.154297 As per an example given in the GAIN Capital API documents LS_user : [the same username that worked in the previous requests] As per the GAIN Capital API documents LS_password : [the current, un-expired session token that I successfully retrieved from the preceding GET request. The session token was retrieved very soon before I attempt to send this request] As per the GAIN Capital API documents What I get: "Error: connect ETIMEDOUT" Tweaks I have tried: using "LS_adapter" instead of "LS_adapter_set" What I get: "Error: connect ECONNREFUSED" using "TCLP-2.0.0" instead of "TCLP-2.2.0" for the LS_protocol parameter What I get: "Error: connect ETIMEDOUT" using "TCLP-2.2.0 HTTP/1.1" instead of "TCLP-2.2.0" for the LS_protocol parameter I tried this because the examples from the Lightstreamer documents have the "HTTP/1.1", but it is not clear to me how or where exactly I am supposed to enter this information when sending my request. A screenshot of the example to which I am referring is attached as "image.png". I understand that this could just come down to me being too unfamiliar with HTTP. What I get: "Error: connect ETIMEDOUT" putting "HTTP/1.1" in the first line of the body of the request For rationale, see previous tweak bullet What I get: "Error: connect ETIMEDOUT" omitting the LS_data_adapter parameter What I get: "Error: connect ETIMEDOUT" Any advice would be very much appreciated!
  4. I know this forum doesn't support Lightstreamer but I am trying to create the smallest working C# .NET console app that will give me a streaming price. Finding the right set of parameters is proving difficult. Looking at the Lightstreamer documentation doesn't really help as this problem might be specific to the CityIndex parameters. I've managed to use the cityindex API for various other stuff without issues, so I have a valid session ID, etc.. Can you see an obvious problem with this code? Any help is greatly appreciated. Chris. void Main() { LightstreamerClient lsClient = new LightstreamerClient("https://push.cityindex.com", "STREAMINGALL"); lsClient.connectionDetails.User = <UserName>; lsClient.connectionDetails.Password = <SessionId>; lsClient.connect(); var testSubscription = new Subscription("MERGE"); testSubscription.Fields = new string[2] { "MarketId", "Bid"}; testSubscription.Items = new string[1] { "PRICE.154297" }; testSubscription.DataAdapter = "PRICES"; //testSubscription.RequestedMaxFrequency = "3.0"; testSubscription.addListener(new QuoteListener()); lsClient.subscribe(testSubscription); Console.WriteLine("Press a key to quit..."); Console.Read(); } class QuoteListener : SubscriptionListener { void SubscriptionListener.onClearSnapshot(string itemName, int itemPos) { Console.WriteLine("Clear Snapshot for " + itemName + "."); } void SubscriptionListener.onCommandSecondLevelItemLostUpdates(int lostUpdates, string key) { Console.WriteLine("Lost Updates for " + key + " (" + lostUpdates + ")."); } void SubscriptionListener.onCommandSecondLevelSubscriptionError(int code, string message, string key) { Console.WriteLine("Subscription Error for " + key + ": " + message); } void SubscriptionListener.onEndOfSnapshot(string itemName, int itemPos) { Console.WriteLine("End of Snapshot for " + itemName + "."); } void SubscriptionListener.onItemLostUpdates(string itemName, int itemPos, int lostUpdates) { Console.WriteLine("Lost Updates for " + itemName + " (" + lostUpdates + ")."); } void SubscriptionListener.onItemUpdate(ItemUpdate itemUpdate) { Console.WriteLine("New update for " + itemUpdate.ItemName); IDictionary<string, string> listc = itemUpdate.ChangedFields; foreach (string value in listc.Values) { Console.WriteLine(" >>>>>>>>>>>>> " + value); } } void SubscriptionListener.onListenEnd(Subscription subscription) { // throw new System.NotImplementedException(); } void SubscriptionListener.onListenStart(Subscription subscription) { // throw new System.NotImplementedException(); } void SubscriptionListener.onRealMaxFrequency(string frequency) { Console.WriteLine("Real frequency: " + frequency + "."); } void SubscriptionListener.onSubscription() { Console.WriteLine("Start subscription."); } void SubscriptionListener.onSubscriptionError(int code, string message) { Console.WriteLine("Subscription error: " + message); } void SubscriptionListener.onUnsubscription() { Console.WriteLine("Stop subscription."); } }
  5. Hi I am experiencing differences between price ticks recorded from lightstreamer, and ticks recieved from GetLastestPriceTIcks. I am finding that sometimes not all the ticks recieved from the stream during a period will be present in the data recieved when calling GetLastestPriceTIcks covering the same period. Should these sources be identical? regards
  6. Hello, I am trying to use the lightstreamer text protocol to create session. But I am getting CONERR,71,License not valid for this client type. Can someone please let me know what I am doing wrong. Here is the http post request I'm using: POST lightstreamer/create_session.txt?LS_protocol=TLCP-2.1.0 HTTP/1.1 Host: https://push.cityindex.com Accept: */* Content-Length: 65 Content-Type: text/plain LS_user=user&LS_adapter_set=STREAMINGALL&LS_cid=mgQkwtwdysogQz2BJ4Ji %20kOj2Bg Thanks
  7. Hello World. I have been lurking and going over old forum posts for the past few weeks and have been able to begin to delve into the Gain API. I have a primarily php project that stores username and session keys on login and so far have gotten GET and POST url requests done, but I am still having trouble with getting a lightstreamer to subscribe to a stream for showing bid and ask prices. So far for the body I want the Bid and Ask/Offer Prices to appear at the head of a table with the code for that below here: <table> <tr> <td>Currency Selected: <?php print_r($_SESSION["currency_pair"]);?> </td> <td> <div id="marketID" data-source="lightstreamer" data-grid="stocks" name="Offer" data-field="Offer" data-item="item1"></div> </td> <td> <div id="marketID" data-source="lightstreamer" data-grid="stocks" data-item="item1" name="Bid" data-field="Bid"></div> </td> </tr> </table> As for my lightstreamer client code I have that at the bottom of the page like this: <script src="assets/js/require.js"></script> <script src="assets/js/lightstreamer.js"></script> <script> define("js/lsClient", ["LightstreamerClient", "StatusWidget"], function(LightstreamerClient, StatusWidget) { var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:"; var portToUse = document.location.protocol == "https:" ? "443" : "80"; // // var lsClient = new LightstreamerClient(protocolToUse + "//push.lightstreamer.com:" + portToUse, "DEMO"); lsClient.connectionSharing.enableSharing("OnlineDemoCommonConnection", "ATTACH", "CREATE"); lsClient.addListener(new StatusWidget("left", "0px", true)); lsClient.connect(); return lsClient; }); </script> <script> require(["LightstreamerClient","Subscription","StaticGrid"],function(LightstreamerClient,Subscription,StaticGrid) { //var ls = require(['lightstreamer-client']); var lsClient = new LightstreamerClient("https://push.cityindex.com", "STREAMINGALL"); lsClient.connectionDetails.setUser("<?php echo $_SESSION["username"]?>"); lsClient.connectionDetails.setPassword("<?php echo $_SESSION["login_session"]?>"); lsClient.connect(); var stocksGrid = new StaticGrid("stocks",true); stocksGrid.setAutoCleanBehavior(true,false); stocksGrid.addListener({ onVisualUpdate: function(key,info) { if (info == null) { //cleaning return; } var cold = (key.substring(4) % 2 == 1) ? "#eeeeee" : "#ddddee"; info.setAttribute("yellow", cold, "backgroundColor"); } }); var marketId = "401484317"; var stockSubscription = new Subscription("MERGE", ["PRICE."+ marketID], ["Bid", "Offer"], true); stockSubscription.addListener(stocksGrid); //stockSubscription.setItems(["PRICE.99588"]) stockSubscription.setDataAdapter("PRICES"); stockSubscription.setRequestedSnapshot("yes"); lsClient.subscribe(stockSubscription); }); </script> But whenever I run it on a local instance for testing, I receive an error in my Chrome Console stating that "IllegalArgumentException", message: "An item name cannot contain spaces". I feel like I am missing something extremely obvious but I have been trying small tweaks for hours. I would like an outside perspective to help see what I have missed.
  8. Hi, I've been using the lightstreamer (Java) to stream prices with a demo account for a while now, and noticed that occasionally it will stop receiving data. The initial connection and subscription work, and the data comes in fine for a few hours, but after leaving in the middle of the day for ~3 hours the stream is usually not updating any more data. As far as I'm aware the connection is still good, because the lightstreamer client doesn't throw any connection lost/dropped signals. I can unsubscribe and resubscribe to immediately begin pulling in more data again, but it usually only lasts a few hours or so. Is this normal? I can upload some of the code if you think that would help, but I'm not sure where the problem in this case would be happening. (Edit: I am using lightstream version 5.1.2 (Legacy) )
  9. Hello, I understand that for getting user portfolio information I need to subscribe to Lightstremer server. My question is that : Do I need to have Lightstreamer server installed on my local machine or I can directly make API calls?
  10. Hello, It seems lightstreamer server was upgraded on 06/25/2019 from older 5.x version to newer 7.x. The new version is now returning a HTTP 400 Bad Request when doing a post to create_session.txt. ------------------------------ POST /lightstreamer/create_session.txt HTTP/1.1 HTTP/1.1 400 Bad Request Server: Lightstreamer-Server/7.0.1 build 1885 (Lightstreamer Server - www.lightstreamer.com) ENTERPRISE edition Date: Tue, 25 Jun 2019 16:18:37 GMT Content-Length: 0 Connection: close x-accel-buffering: no ------------------------------ According to latest documentation on lightstreamer.com, the new version expects a LS_protocol=TLCP-2.1.0 tag added to the post. When passing this tag, the server responds with invalid license message. Please provide assistance on how the create_session.txt should be used. Is the server not configured properly? ------------------------------ POST /lightstreamer/create_session.txt?LS_protocol=TLCP-2.1.0 HTTP/1.1 HTTP/1.1 200 OK Server: Lightstreamer-Server/7.0.1 build 1885 (Lightstreamer Server - www.lightstreamer.com) ENTERPRISE edition Content-Type: text/enriched; charset=ISO-8859-1 Cache-Control: no-store Cache-Control: no-transform Cache-Control: no-cache Pragma: no-cache Expires: Thu, 1 Jan 1970 00:00:00 GMT Date: Tue, 25 Jun 2019 16:17:56 GMT Content-Length: 50 x-accel-buffering: no CONERR,71,License not valid for this Client type ------------------------------
  11. Hello, I'm having some problems with logging into lightStreamer. The error I'm getting is "User/password check failed" Currently, I'm using NodeJS to attempt to get data from the lightstreamer API but I have been unable to do so. Based on the posts from others and the Forex documentation, here is what I have checked for: Forex uses 5.1.2 of lightstreamer server so I had to use an older version of the Node JS client to be compatible ( version 6.1.4 specifically) The username is the one we use for the REST API The password is the one that is requested upon login to the rest API. I'm able to login to the REST API without any problems. I'm I missing anything here? Please take a look at my snippet of code and let me know if anything stands out. Thanks var ls = require("lightstreamer-client"); var lsClient = new ls.LightstreamerClient("https://push.cityindex.com", "STREAMINGALL"); lsClient.connectionDetails.setUser = "<Username>"; lsClient.connectionDetails.setPassword = "<Password Hash>"; lsClient.connect(); marketId = "401484317"; var testSubscription = new ls.Subscription("MERGE", ["PRICE." + marketId], ["MarketId", "TickDate", "Bid"]); testSubscription.setDataAdapter("PRICES"); //testSubscription.setItems(["PRICES.PRICE" + marketId]); testSubscription.setRequestedSnapshot("yes"); lsClient.subscribe(testSubscription); lsClient.addListener({ onStatusChange: function (newStatus) { console.log(newStatus); }, onServerError: function (errorCode, errorMessage) { console.log(errorCode); console.log(errorMessage); } });
  12. Hi, I am trying to get the lighstreamer java se get going but facing some issue. please let me know if anything is wrong with the below code. I am not getting any updates at all after subscription. String[] items = { "PRICE.401484392","GBP/USD" }; String[] fields = { "MarketId", "TickDate", "Bid", "Offer", "Price", "High", "Low", "Change", "Direction", "Delta", "ImpliedVolatility", "AuditId", "StatusSummary" }; LightstreamerClient client = new LightstreamerClient(serverAddress, "STREAMINGALL"); client.connectionDetails.setUser("XXXXXXXX"); client.connectionDetails.setPassword("XXXXXXXXXXXXXXXXXXXXXXXXX"); client.connectionDetails.setAdapterSet("STREAMINGALL"); ClientListener clientListener = new SystemOutClientListener(); client.addListener(clientListener); Subscription sub = new Subscription("MERGE", items, fields); sub.setRequestedSnapshot("yes"); sub.setDataAdapter("PRICES"); SubscriptionListener subListener = new SystemOutSubscriptionListener(); sub.addListener(subListener); client.subscribe(sub); client.connect();
  13. HI again @Physicsman - my lightstreamer feed seems to be having some issues and I wanted to check whether that's due to me or the server. It was working fine last Friday, and has been working fine for some months now. However today I'm authenticating the session ok, connecting to the lightstreamer server, even starting the streaming session... and then the connection is refused: Lightstreamer.DotNet.Client.PushConnException: Unable to connect to the remote server ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it Before I embark upon an epic journey to try to figure out what's broken, would you be able to tell me whether the lightstreamer is up and running or whether there is another reason why it might have stopped working for me? Maybe something changed or it's been upgraded or something? Thank you so much, oli
  14. Dear community, I'm trying to establish connection with Lightsrteamer using JavaScript library. First problem which i was able to resolve is getting js library for Lightstreamer server version 5. Unfortunately i could not find compatible client library version in npm, so only option for me for now is this generator. For investigation i'm using following code request .post('https://ciapi.cityindex.com/tradingapi/session') .set('Accept', 'application/json') .send({ UserName: USERNAME, Password: PASSWORD, AppKey: APPKEY, AppVersion: '1', AppComments: '' }) .end((err, res) => { this.setState({ sessionId: res.body.Session }) var lsClient = new Lightstreamer.LightstreamerClient("https://push.cityindex.com/", 'STREAMINGALL'); lsClient.addListener({ onStatusChange: function (newStatus) { console.log('onStatusChange', newStatus); } }); lsClient.connectionDetails.setUser(USERNAME); lsClient.connectionDetails.setPassword(res.body.Session); lsClient.connect(); }); as you can see i use USERNAME and SessionId as password as Lightstreamer password. In console i can see request to Lightstreamer to create a session: POST https://push.cityindex.com/lightstreamer/create_session.js with post data: LS_phase: 3157 LS_cause: timeout.2.0 LS_polling: true LS_polling_millis: 0 LS_idle_millis: 0 LS_client_version: 6.1 LS_adapter_set: STREAMINGALL LS_user: <CORRECT_USERNAME> LS_password: <CORRECT_SESSION_ID> LS_container: lsc Response status code is 200 response body is: /* var myEnv = lsc; var phase = null; function setPhase(ph) { phase = ph; } function start(sID, addr, kaMs, reqLim, srv) { LS_window.LS_e(1, phase, sID, addr, kaMs, reqLim, srv); } function loop(holdMs) { LS_window.LS_e(2, phase, holdMs); } setPhase(3157);start('<SOME_IDENTIFICATOR>', 'PUSH1.CITYINDEX.COM', 0, 50000, 'Lightstreamer HTTP Server');loop(0); */ Lightstreamer library keeps sending POST /create_session.js requests every ~4 seconds onStatusChange listener output is: 11:34:34.354 App.js:51 onStatusChange CONNECTING 11:34:39.343 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:34:39.346 App.js:51 onStatusChange CONNECTING 11:34:44.146 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:34:44.147 App.js:51 onStatusChange CONNECTING 11:34:49.349 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:34:49.350 App.js:51 onStatusChange CONNECTING 11:34:54.157 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:34:54.158 App.js:51 onStatusChange CONNECTING 11:34:59.246 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:34:59.247 App.js:51 onStatusChange CONNECTING 11:35:03.295 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:35:03.296 App.js:51 onStatusChange CONNECTING 11:35:07.952 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:35:07.954 App.js:51 onStatusChange CONNECTING 11:35:12.347 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY 11:35:12.350 App.js:51 onStatusChange CONNECTING 11:35:16.380 App.js:51 onStatusChange DISCONNECTED:WILL-RETRY If there are some chance to check logs, one of my session ids is 1c81dc88-a6cb-4086-ae7c-b7114860b3fa At this point i expect to have well established connection. Obviously i'm doing something wrong in here. Could you please suggest where to dig? Thank you very much indeed Cheers
  15. Hello, I have created a console app to get the prices from LightStreamer. The code which is from an topic on your forum is as below using System; using Lightstreamer.DotNet.Client; namespace LightStreamerDemo { class Program { static void Main(string[] args) { var lightStreamClient = new LSClient(); var connectionInfo = new ConnectionInfo { PushServerUrl = "https://pushpreprod.cityindextest9.co.uk", Adapter = "CITYINDEXSTREAMINGDEFAULTPRICES" }; lightStreamClient.OpenConnection(connectionInfo, new MyConnectionListener()); var tableInfo = new ExtendedTableInfo(new[] { "AC2347" }, "MERGE", new[] { "MarketId", "TickDate", "Bid", "Offer", "Price", "High", "Low", "Change", "Direction", "AuditId" }, true); tableInfo.DataAdapter = "PRICES"; SubscribedTableKey tableKey = null; tableKey = lightStreamClient.SubscribeTable(tableInfo, new MyTableListener(), false); Console.WriteLine("Press a key to quit..."); Console.ReadKey(); } class MyConnectionListener : IConnectionListener { public void OnDataError(PushServerException ex) { Console.WriteLine("Exception: {0}", ex); } public void OnFailure(PushServerException ex) { } public void OnFailure(PushConnException ex) { } public void OnConnectionEstablished() { } public void OnSessionStarted(bool isPolling) { } public void OnNewBytes(long bytes) { } public void OnActivityWarning(bool warningOn) { } public void OnClose() { } public void OnEnd(int cause) { } } class MyTableListener : IHandyTableListener { public void OnUpdate(int itemPos, string itemName, IUpdateInfo update) { Console.WriteLine("\nMyTableListener.OnUpdate - ItemPos:{0} - itemName:{1}", itemPos, itemName); for (int index = 1; index < update.NumFields + 1; index++) { Console.WriteLine("oldValue:{0} -> newValue:{1}", update.GetOldValue(index), update.GetNewValue(index)); } } public void OnSnapshotEnd(int itemPos, string itemName) { } public void OnRawUpdatesLost(int itemPos, string itemName, int lostUpdates) { } public void OnUnsubscr(int itemPos, string itemName) { } public void OnUnsubscrAll() { } } } } The problem is that I always get the an Lightstreamer.DotNet.Client.PushUserException execption with ErrorMessage "Unrecognized Group name". I guess the problem is from the value of "Group" parameter of ExtendedTableInfo in the code, but I don't know how to fix this. Would you please show me the way to solve this problem? Additionally, I'm a newbie in LightStreamer. So would you please show me how to get the quote prices of a FOREX symbol (such as USD/CAD) from LightStreamer? Specifically, I mean how should I implement to get the quote price of USD/CAD in the code above? It's very helpful for me if there is a specific example. Thanks a lot!
  16. Hi. We are probably facing an issue with LightStreamer and I'd appreciate any help on it. Let's assume that I start listening to EUR/USD prices on Friday evening. At 22:00 UTC the market closes and that's perfectly fine. I check the incoming data on Saturday afternoon and it's still bound to Friday 22:00 UTC. And finally - I come back to check the data on Monday morning and I see a whole bunch of prices with stamp ranging from Friday 22:00 UTC to Sunday 22:00 UTC. How can I avoid receiving those fake prices?
  17. Hello, i want to subscribe to ORDERS channel but i have problems with translating CI documentation phrases to LightStreamer iSO SDK vocabulary. I am already successful in subscribing for PRICES channel. This is how i configured ORDERS subscription: LSSubscription *subscription = [[LSSubscription alloc] initWithSubscriptionMode:@"RAW"]; subscription.items = @[ @"ORDERS" ]; subscription.fields = @[ @"OrderId", @"MarketId" ]; subscription.dataAdapter = @"ORDERS"; subscription.requestedSnapshot = @"no"; [subscription addDelegate:self]; [self.client subscribe:subscription]; I am getting the error that "Group" name is invalid, so i tried changing "items" from "ORDERS" to "ORDERS.ORDERS" but then even without getting error i still get no updates for ORDERS. Can someone help me figure this out?
  18. I noticed what appears to be an unavoidable latency on the Lightstreamer price feeds, and would like to confirm whether or not this is actually the case. When running on a machine with good network connectivity, that is ~17ms from the CIAPI streaming servers, as measured by examining the TCP/IP stack’s RTT statistics with TCP keep-alive enabled and the timer set to 1sec, the following plot was recorded: Min. 1st Qu. Median Mean 3rd Qu. -2.480983734 124.401330950 199.357509610 319.881618950 287.830829620 Max. 32144.682884000 Latency here is measured by subtracting the (NTP synchronized) current time on the machine with the ‘TickDate’ field from Lightstreamer. I am wondering if this is a feature of your Lightstreamer configuration, since as can be seen, occasionally the problem does not manifest (perhaps corresponding to periods of many price changes causing some buffer to be flushed). In general variance seems to be surprisingly high, sometimes more than 2 seconds (0.4% of samples) and 5 seconds (0.2% of samples). The end result would be an increased order failure rate, as the AuditId from this stream is required to trade successfully. Is it possible that the machine(s) generating TickDate field have out of sync clocks? I note one tick with a negative(!) latency, suggesting this is at least partially true. (I verified my local NTP status prior to recording the trace). Edit: just worth noting the 32 second latency may be due to a bug in my client’s reconnect code, so not too worried about that for now.
  19. Hi, could someone please tell me whether the news streaming feed is active as I’m not getting any data update? For information, I’m not using the CIAPI client, however I’ve compared the settings I’m currently using with the ones in the CIAPI project and they seen to be aligned: endpoint: CITYINDEXSTREAMING channel: NEWS group: HEADLINES.UK I don’t think this is down to my implementation of the Lightstreamer .Net client as other streams (ClientAccountMargin, DefaultPrices, Prices…) work fine. Thanks
  20. Is there a way to add new markets to an existing Lightstreamer price feed Listener?
  21. Hi guys, I want to report a problem I’ve seen with the Lightstreamer Net client when I was trying to get the “DefaultPrices” using an ExtendedTableInfo object. Let me say that there is a simple work around it (using a SimpleTableInfo) but I think it still worth listing the problem on here as it can be useful to other people (and as you can see in this post, I’m not the only one who has run into it). Note that the CIAPI.cs implements the SimpleTableInfo, so everyone using CIAPI.cs will be fine. The problem I’ve got is that I can only get the first set of data (for the EUR/USD market), and the lightstreamer .Net Client throws a PushServerException (with Wrong Item Number as message) for the 7 other sets of market data returned. Error in received values Lightstreamer.DotNet.Client.PushServerException: Wrong item number at Lightstreamer.DotNet.Client.FullTableManager.ProcessUpdate(ServerUpdateEvent values, Int32 itemPos, Int32 itemIndex) in c:\LIGHTSTREAMER\PROJECT_Lightstreamer_3_DotNetClient_1\DotNetClient\Source\FullTableManager.cs:line 234 at Lightstreamer.DotNet.Client.FullTableManager.DoUpdate(ServerUpdateEvent values) in c:\LIGHTSTREAMER\PROJECT_Lightstreamer_3_DotNetClient_1\DotNetClient\Source\FullTableManager.cs:line 214 at Lightstreamer.DotNet.Client.MyServerListener.OnUpdate(ITableManager table, ServerUpdateEvent values) in c:\LIGHTSTREAMER\PROJECT_Lightstreamer_3_DotNetClient_1\DotNetClient\Source\MyServerListener.cs:line 75 Using Fiddler, I can see that 8 sets of data have been sent from the server to the client, but for some reason the client cannot retrieve anythng else than the first set (MarketId = 400494226) PROBE 1,2|400494234|\u005C/Date(1325884513179)\u005C/|1.54303|1.54353|1.54328|1.55252|1.53760|-0.00626|1|sbPreProdFX91678343 1,4|400494241|\u005C/Date(1325884513197)\u005C/|0.95488|0.95533|0.95511|0.95789|0.95061|0.00268|1|sbPreProdFX78238222 1,8|400494179|\u005C/Date(1325884513104)\u005C/|1.02256|1.02316|1.02286|1.02718|1.02018|-0.00337|1|sbPreProdFX75296235 1,7|400494220|\u005C/Date(1325884513129)\u005C/|97.917|97.951|97.934|98.857|97.911|-0.695|1|sbPreProdFX93918355 1,5|400494249|\u005C/Date(1325884513229)\u005C/|3.53472|3.54382|3.53927|3.54000|3.49985|0.01657|0|sbPreProdFX90055666 1,3|400494246|\u005C/Date(1325884513223)\u005C/|76.986|77.012|76.999|77.339|76.968|-0.126|1|sbPreProdFX91678452 1,6|400494215|\u005C/Date(1325884513127)\u005C/|1.21461|1.21524|1.21492|1.21978|1.21483|-0.00308|1|sbPreProdFX75296285 1,1|400494226|\u005C/Date(1325884513155)\u005C/|1.27175|1.27203|1.27189|1.28127|1.26977|-0.00694|1|sbPreProdFX93918338 LOOP I’m not expecting any resolution of this issue (not sure if it’s not a bug with the Lighstreamer Net client), but if someone is interrested to reproduce, here is a very small code sample that I’ve put together (just copy the snippet into the program.cs of a VS Console app and make sure you add a reference to the lightstreamer DotNetClient_N2.dll assembly). To make this code works, comment out the use of ExtendedTableInfo and uncomment the following lines to use SimpleTableInfo. using System; using Lightstreamer.DotNet.Client; class Program { static void Main() { var lsClient = new LSClient(); var connectionInfo = new ConnectionInfo { PushServerUrl = "https://pushpreprod.cityindextest9.co.uk", Adapter = "CITYINDEXSTREAMINGDEFAULTPRICES" }; lsClient.OpenConnection(connectionInfo, new MyConnectionListener()); var tableInfo = new ExtendedTableInfo(new[] { "AC2347" }, "MERGE", new[] {"MarketId", "TickDate", "Bid", "Offer", "Price", "High", "Low", "Change", "Direction", "AuditId"}, true); //var tableInfo = new SimpleTableInfo("AC2347", // "MERGE", // "MarketId TickDate Bid Offer Price High Low Change Direction AuditId", // true); tableInfo.DataAdapter = "PRICES"; SubscribedTableKey tableKey = null; try { tableKey = lsClient.SubscribeTable(tableInfo, new MyTableListener(), false); Console.WriteLine("Press a key to quit..."); Console.ReadKey(); } catch (Exception ex) { Console.WriteLine("Exception: {0}", ex); } finally { lsClient.UnsubscribeTable(tableKey); lsClient.CloseConnection(); } } class MyConnectionListener : IConnectionListener { public void OnDataError(PushServerException ex) { Console.WriteLine("Exception: {0}", ex); } public void OnFailure(PushServerException ex) { } public void OnFailure(PushConnException ex) { } public void OnConnectionEstablished() { } public void OnSessionStarted(bool isPolling) { } public void OnNewBytes(long bytes) { } public void OnActivityWarning(bool warningOn) { } public void OnClose() { } public void OnEnd(int cause) { } } class MyTableListener : IHandyTableListener { public void OnUpdate(int itemPos, string itemName, IUpdateInfo update) { Console.WriteLine("\nMyTableListener.OnUpdate - ItemPos:{0} - itemName:{1}", itemPos, itemName); for (int index = 1; index < update.NumFields + 1; index++) { Console.WriteLine("oldValue:{0} -> newValue:{1}", update.GetOldValue(index), update.GetNewValue(index)); } } public void OnSnapshotEnd(int itemPos, string itemName) { } public void OnRawUpdatesLost(int itemPos, string itemName, int lostUpdates) { } public void OnUnsubscr(int itemPos, string itemName) { } public void OnUnsubscrAll() { } } }
  22. The Excel Addin (using the .NET Lightstreamer client) occasionally looses the streaming connection for prices with the following error: Read answer: SYNC ERROR Error in rebinding to the session Lightstreamer.DotNet.Client.PushServerException: Session not found at Lightstreamer.DotNet.Client.PushServerTranslator.CheckAnswer(StreamReader answer) in D:\projects\CIAPI\CIAPI.CS\src\StreamingClient.Lightstreamer\Lightstreamer.dotNetClient_N2\PushServerTranslator.cs:line 412 at Lightstreamer.DotNet.Client.PushServerProxy.ResyncSession() in The server side logs contain: 26-Jul-11 15:34:54,819 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 10 |Sync error: Can't find session from Full details of the error & related logs athttps://github.com/cityindex/CIAPI.CS/issues/53#issuecomment-1661256 Do you have any idea what the cause of this issue is; and how to go about resolving it?