Jump to content

Search the Community

Showing results for tags 'streaming'.

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 12 results

  1. 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?
  2. Hello. We use a java lightstream client with 'RAW' subscription mode to acquire the orders. Is it possible to get the lost orders which occur while the client restart? Kind Regards.
  3. Hello. How long a session token is valid while using streaming data exchange?
  4. 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?
  5. We have observed that Trade Margin stream cadence is very slow compared with other stream services like prices or news. Despite that we are concerned on the time it takes the first value to arrive, more than 30 seconds in average. David says that the mechanism CIAPI.CS uses to subscribe to all the streams is the same, so the delay won’t be on the client side. The amount of server side work required to calculate trade margin is much more than just passing prices. I believe that as a result margin is only calculated every 30 seconds, and could possibly be slower in high load periods. Peter says that this doesn’t occur on other platforms and that the value is cached so it shouldn’t take so much time to appear. So my question would be: why it takes so much time for the first Unrealised P&L value to arrive through margin stream if it is cached?
  6. The orders stream should return a decimal value for the ExecutionPrice property However, it currently seems to be returning the string “CityIndex.Atlas.Business.OrderExecutionPrice”. The following test recreates this behaviour on PPE, producing the logs like the following: 4/30/2012 4:22:15 PM [INFO] com.lightstreamer.ls_client.actions - Adding MERGE table [ORDERS ; AutoRollover ClientAccountId CurrencyId CurrencyISO Direction ExecutionPrice LastChangedTime MarketId OpenPrice OrderId OriginalLastChangedDateTime OriginalQuantity PositionMethodId Quantity ReasonId Status TradingAccountId Type] to session Sfad9db06fbf5409cT2215005 2012-04-30 16:22:22Z [INFO] Salient.ReliableHttpClient.RequestController - Received #4 : https://ciapipreprod.cityindextest9.co.uk/TradingApi/order/newtradeorder 2012-04-30 16:22:22Z [DEBUG] Salient.ReliableHttpClient.RequestInfo - request completed: latency 00:00:00.9490000 ITEM Item: #4 POST https://ciapipreprod.cityindextest9.co.uk/TradingApi/order/newtradeorder [719f89c9-8a81-470f-89c1-d016f2a32552] Target/UriTemplate: https://ciapipreprod.cityindextest9.co.uk/TradingApi/order/newtradeorder State: Processing Headers: UserName = DM813766 Session = 33b66585-6ba0-44a1-83d4-05b85c5bf5f6 Parameters: trade = CIAPI.DTO.NewTradeOrderRequestDTO Content Type: request - JSON, response - JSON Body: {"MarketId":154297,"Currency":null,"AutoRollover":false,"Direction":"buy","Quantity":2.00000000,"QuoteId":null,"BidPrice":1.62310,"OfferPrice":1.62328,"AuditId":" 4/30/2012 4:22:22 PM [DEBUG] com.lightstreamer.ls_client.stream - Read data: 2,1|false|400134233|11||1|CityIndex.Atlas.Business.OrderExecutionPrice|\u005C/Date(1335799341000)\u005C/|154297|1.62328|478010838|\u005C/Date(1335799341000)\u005C/|2.00000000|1|2.00000000|1|Open|400198331|Trade 4/30/2012 4:22:22 PM [DEBUG] com.lightstreamer.ls_client.protocol - Read event for item n°1 in table n°2 with values [false, 400134233, 11, UNCHANGED, 1, CityIndex.Atlas.Business.OrderExecutionPrice, \/Date(1335799341000)\/, 154297, 1.62328, 478010838, \/Date(1335799341000)\/, 2.00000000, 1, 2.00000000, 1, Open, 400198331, Trade] 4/30/2012 4:22:22 PM [DEBUG] com.lightstreamer.ls_client.actions - Got event for item 1 with values [false, 400134233, 11, UNCHANGED, 1, CityIndex.Atlas.Business.OrderExecutionPrice, \/Date(1335799341000)\/, 154297, 1.62328, 478010838, \/Date(1335799341000)\/, 2.00000000, 1, 2.00000000, 1, Open, 400198331, Trade] 4/30/2012 4:22:22 PM [DEBUG] com.lightstreamer.ls_client.actions - Notifying event for item 1 with values [ false, 400134233, 11, (null), 1, CityIndex.Atlas.Business.OrderExecutionPrice, \/Date(1335799341000)\/, 154297, 1.62328, 478010838, \/Date(1335799341000)\/, 2.00000000, 1, 2.00000000, 1, Open, 400198331, Trade ] A first chance exception of type 'System.FormatException' occurred in mscorlib.dll A first chance exception of type 'System.FormatException' occurred in CIAPI.Phone7.dll 2012-04-30 16:22:22Z [ERROR] StreamingClient.TableListener`1[[CIAPI.DTO.OrderDTO, CIAPI.Phone7, Version=, Culture=neutral, PublicKeyToken=null]] - System.FormatException: FormatException This seems like a bug in the streaming API implementation. Could you confirm? Thanks
  7. 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() { } } }
  8. I havent done much in c# so i am a bit illiterate. Could someone provide sample code for just Logging in, then starting a streaming client and attaching an Action Listener to it (I assume that is how your ment to do it). I am not entirely sure what i am doing wrong but the “UK 100 Rolling Spread” single values i have been able to stream using stuff i scraped from“https://github.com/cityindex/CIAPI.CS/”. Were not even near the sell/buy price on my normal city index account. Sorry to ask for so much but i found the sample code on the api very unhelpful Thanks for the help in advance:)
  9. 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?
  10. In the Excel Addin I want to display a “grid” of current positions. I’d like the value of said positions to be updated as the prices change. Is there any way to get these updates via the streaming API, or should I be pollingListOpenPositions?
  11. I’m trying to subscribe for news stream (using WPF), and the sample code hangs on IStreamingListener.Start() call for some indefinite time. (I waited 5 mins). Nothing seem to happen, and only debug output shows this message from time to time: A first chance exception of type ‘Lightstreamer.DotNet.Client.PushLengthException’ occurred in StreamingClient.Lightstreamer.dll Stack trace: > StreamingClient.Lightstreamer.dll!Lightstreamer.DotNet.Client.PushServerTranslator.WaitCommand(System.IO.StreamReader pushStream) Line 740 C# StreamingClient.Lightstreamer.dll!Lightstreamer.DotNet.Client.PushServerProxy.WaitCommand(Lightstreamer.DotNet.Client.ServerManager.ActivityController activityController) Line 417 + 0x11 bytes C# StreamingClient.Lightstreamer.dll!Lightstreamer.DotNet.Client.PushServerProxy.WaitUpdate(Lightstreamer.DotNet.Client.ServerManager.ActivityController activityController) Line 457 + 0xc bytes C# StreamingClient.Lightstreamer.dll!Lightstreamer.DotNet.Client.ServerManager.WaitEvents() Line 336 + 0x14 bytes C# StreamingClient.Lightstreamer.dll!Lightstreamer.DotNet.Client.ServerManager.SessionActivityManager.Run() Line 667 + 0xe bytes C# mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x63 bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xb0 bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x2c bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes Exception is thrown one line upper this string: if (extraMsg.StartsWith(“END”)) error message is “Connection consumed” UPD this problem happens, when using http (not https) streaming URL. UPD2 surprisingly, the same code works with Silverlight version (using http) and accepts newsfeeds correctly
  12. Could some one guide me how to test subscribing to news feature of CIAPI.CS. I have written some code for it and it is executing without errors, but as I got no new news events from server so I am not sure if my code is working fine. I want to know a way to test it properly.