Panda_don
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Community Tutorials
Store
Posts posted by Panda_don
-
-
Can't seem to find an answer to the two questions below:
I use the following code to subscribe to prices:
from lightstreamer_client import LightstreamerSubscription
market_session = IgStreamingSession(api_key, account_id, rest_api_username, rest_api_password)
market_subscription = LightstreamerSubscription('MERGE',
markets_to_stream,
['OFR_OPEN','OFR_HIGH','OFR_LOW','OFR_CLOSE','BID_OPEN','BID_HIGH','BID_LOW','BID_CLOSE','UTM','CONS_END'])market_subscription.addlistener(lambda item: do_something_with(item))
market_streaming_response = market_session.subscribe(market_subscription)
1) If I want to unsubscribe to this particular stream (specifically this one as I have other concurrent streams running that I want to continue) - how do I do that?
2) If I want to update the list: markets_to_stream, and receive stream results only for the new list - how can I do that?
I have seen this:
# Unsubscribing from Lightstreamer by using the subscription key
lightstreamer_client.unsubscribe(sub_key)# Disconnecting
lightstreamer_client.disconnect()but do not know how to apply it to my code as mine is slightly different?
Adjust stopLevel using streaming api data
in General Trading Strategy Discussion
Posted
Hey,
See you are using the same a me and am wondering about two things:
1) do you know how to unsubscribe from the subscription just made
2) how to update the subscription eg. from bitcoin to ethereum