Jump to content

Yooyi

Members
  • Content count

    3
  • Joined

  • Last visited

  1. Place market order

    Hi, yeah I already use my username and the session to request a Lightstreamer connection but the problem is the Subscription, I don't know if its good or not plus the server just answer 'ERROR' and nothing else subscription = Subscription( mode="MERGE", items=["PRICES.PRICE.154297"], fields=["MarketId", "TickDate", "Bid"], adapter="STREAMINGALL") Here is the log : 2019-12-06 10:22:29,603 DEBUG MainThread Opening a new session to <https://push.cityindex.com/> 2019-12-06 10:22:29,604 DEBUG MainThread Making a request to <https://push.cityindex.com/lightstreamer/create_session.txt> with body <b'LS_op2=create&LS_cid=****+kOj2Bg&LS_adapter_set=STREAMINGALL&LS_user=DA****&LS_password=****-99c7-434f-****-e1a8fc0f7f1e'> 2019-12-06 10:22:29,887 INFO MainThread Successfully connected to <https://push.cityindex.com/> 2019-12-06 10:22:29,887 DEBUG MainThread Starting to handling real-time stream 2019-12-06 10:22:29,889 DEBUG StreamThread-0 Waiting for a new message 2019-12-06 10:22:29,889 INFO MainThread Started handling of real-time stream Trying to subscribe 2019-12-06 10:22:29,889 DEBUG MainThread Making a new subscription request 2019-12-06 10:22:29,889 DEBUG MainThread Making a request to <https://pusha202.cityindex.com/lightstreamer/control.txt> with body <b'LS_Table=1&LS_op=add&LS_data_adapter=STREAMINGALL&LS_mode=MERGE&LS_schema=MarketId+TickDate+Bid&LS_id=PRICES.PRICE.154297&LS_session=****'> 2019-12-06 10:22:30,175 DEBUG MainThread Server response: <ERROR> 2019-12-06 10:22:30,178 WARNING MainThread Subscription error 2019-12-06 10:22:32,179 DEBUG MainThread Making an unsubscription request 2019-12-06 10:22:32,179 DEBUG MainThread Making a request to <https://pusha202.cityindex.com/lightstreamer/control.txt> with body <b'LS_Table=1&LS_op=delete&LS_session=****'> 2019-12-06 10:22:32,460 DEBUG MainThread Server response: <ERROR> 2019-12-06 10:22:32,462 WARNING MainThread Unsubscription error 2019-12-06 10:22:32,463 DEBUG MainThread Closing session to <https://push.cityindex.com/> 2019-12-06 10:22:32,463 DEBUG MainThread Making a request to <https://pusha202.cityindex.com/lightstreamer/control.txt> with body <b'LS_op=destroy&LS_session=****'> 2019-12-06 10:22:32,716 DEBUG StreamThread-0 Received message: <END 31> 2019-12-06 10:22:32,716 DEBUG MainThread Server response: <OK> 2019-12-06 10:22:32,717 INFO StreamThread-0 Connection closed by the server 2019-12-06 10:22:32,718 DEBUG MainThread Waiting for thread to terminate 2019-12-06 10:22:32,719 DEBUG StreamThread-0 No rebind to <https://push.cityindex.com/>, clearing internal session data 2019-12-06 10:22:32,721 DEBUG MainThread Thread terminated 2019-12-06 10:22:32,722 INFO MainThread Closed session to <https://push.cityindex.com/>
  2. Place market order

    Hi thank you for your reply, I tried implement Lightstreaming in Python, however you are using Lightstreamer 4 and the example provided on Github is for 6+. They provide an example for Lightstreamer 5.1.2 that I assume is compatible with 4 but for Python 2, I tried to port it to python 3 and its kinda work, I only get 'OK' from the server but apparently I should receive a session_key and a session_value. Do you have any idea ?
  3. Hi I just wanted to know if I could make market order ? From what I read on the forum and on the docs I need to send the order with the right Bid and Offer from the data collected with Lightstreamer, however I think using Lightstreamer is overkill from what I want to do. Do you know any other alternative to acheive what I want ? I think using another api to get the right price just before making a trade would be good but not all the broker shows the same price or have the same spread thank you.
×