Page 3 of 7 FirstFirst 12345 ... LastLast
Results 21 to 30 of 64
  1. #21
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi Colombao,

    the script was meant to be very minimal, just to work in very simple cases, also from a deployment perspective. In your scenario, Lightstreamer server is behind a load balancer, so after a client establishes a new session it has to contact the correct target machine (whose server address is carried in the response as per the Lightstreamer Text Protocol) for all control requests. Here you can find more details on this.

    Moreover, I can confirm that by subscribing to the items "L1:CS.D.GBPUSD.CFD.IP" and "MARKET:CS.D.GBPUSD.CFD.IP", the real-time updates are printed out on the console.

    I've just modified and uploaded the demo with required fixes. Just check it out from GitHub and let me know,

    Thanks for reporting such issues!
    Regards,
    Gianluca
    Last edited by gianluca.finocchiaro; January 12th, 2015 at 10:48 AM.

  2. #22
    Member
    Join Date
    Dec 2014
    Location
    Milan
    Posts
    13
    Many Thanks Gianluca! It works my side. Great job!
    br, Colombao

  3. #23
    Hi there Gianluca,

    I am developing a trading API for use with Cityindex and for very limited purposes (running scripts for download of one single currency pair of choice and then placing a trade). I would like to keep this as simple as possible and it seems to me that your example on github along with the link to the code for IG provide a perfect starting point.

    Do you have or do you know of an implementation of a variation of stock_list_demo.py along the lines of LS_IG_test_Colombao_v01.py but for Cityindex?

    Thanks so much!

    William

  4. #24
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi William,

    I'm sorry but I'm not aware of any current Python implementation for Cityindex.
    Anyway, reading through their documentation, it should not be so hard to adapt our example to fit Cityindex specific features, with something like the following (for what related to connection and authentication):


    After that, you could submit your subscription as per your requirements (solution based on information available on the Cityindex discussion forum);


    Let me know if this helps.

    Regards,
    Gianluca

  5. #25
    Hello Gianluca,

    Thanks for responding so promptly. This definitely helps very much and is pretty close to what had in mind. I will keep you posted and send a link to the code once I have it working.

    Thanks!

    William

  6. #26
    Update to the original message below:

    I started looking into the Network Protocol Tutorial and also the General Concepts (which are both very well written in my opinion) and think it will make more sense for me to begin at very basic level implementing the http/https requests.

    Using curl, I can do

    Code:
    curl -v -H "Content-Type: charset=UTF-8" "https://push.cityindex.com/lightstreamer/create_session.txt?LS_op2=create&LS_cid=mgQkwtwdysogQz2BJ4Ji%20kOj2Bg&LS_adapter_set=STREAMINGALL&LS_user=MYUSERID&LS_password=MYSESSIONID" -X GET
    where MYUSERID is my user name and MYSESSIONID is the id of an active session I started before with the rest API. Executing the curl command gives no error and results in the output of the LS session id followed by a steady flow of PROBE messages.

    For the next step, i.e. the subscription, I need to read more of the above-mentioned documents, but I think something like this should be close:

    Code:
    curl -v -H "Content-Type: charset=UTF-8" "https://push.cityindex.com/lightstreamer/control.txt?LS_session=MYLSSESSIONID&LS_table=1&LS_op=add&LS_data_adapter=PRICES&LS_id=154290&LS_schema=LAST_PRICE&LS_mode=MERGE&LS_snapshot=true" -X GET
    where MYLSSESSIONID is the value returned when I created the session.

    When I try the command in a second terminal. it isn't quite working yet as it doesn't return the price, but I get a notice in the first window containing the table number.I suspect that the following are good candidates for entries whose values aren't correct yet: LS_data_adapter, LS_schema, LS_mode, LS_snapshot.


    __________________________________________________ __________________________________________________ ______

    Original message:

    Hello again, Gianluca,

    So after a slight modification of what you sent, it seems I am getting close, I can connect and disconnect, and the terminal output seems to suggest subscribe and unsubscribe work and there is no error message.

    However, there are no prices displayed, and it looks like I can choose some meaningless values for the subscription item and still get no error message. My Cityindex account is a test account and I would be happy to send you a pm with my modified script and credentials if you think you could take a shot at this. Thanks so much!
    Last edited by socalwill; October 21st, 2015 at 09:50 AM. Reason: update

  7. #27
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi William,

    it would be helpful some screenshot from your side of the running script. We could also some additional log to check what happens.

    Thanks!
    Gianluca

  8. #28
    Hi and thanks so much - I just saw your message after updating the post. Do you happen to have access to a Mac or Linux box or maybe cygwin under Windows? I am thinking curl could be great to efficiently get to the bottom of things.

  9. #29
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi William,

    I can't manage to issue the commands of your post, because I would need your real credentials...

    Anyway, in the control request for submitting the subscription (your second command) the "LS_Session" parameter must be set with the SessionId got as result of the first command, when you requested to open the session.

    Let me know.
    Gianluca

  10. #30
    Hello Gianluca - yes, that's what I did. I just sent you a pm with the commands and the server messages. I believe that should be helpful for you. Thanks!

 

 

Similar Threads

  1. Python Client Library for Lightstreamer
    By Alessandro in forum Client Protocol
    Replies: 1
    Last Post: December 18th, 2014, 06:15 PM
  2. how to comunicate lightstreamer server by python
    By keyan in forum Client APIs
    Replies: 4
    Last Post: December 18th, 2014, 06:12 PM
  3. Replies: 2
    Last Post: January 5th, 2012, 09:53 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:52 AM.