SHARE
TWEET

recycled---

selnomeria Feb 7th, 2020 (edited) 74 in 212 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import requests
  2. from td.client import TDClient
  3.  
  4. TDSession = TDClient(account_number = 'xxxxxxxxxxxxx',
  5.                     account_password = 'xxxxxxxxxxxxxxx',
  6.                     consumer_id = 'xxxxxxxxxxxxxxxx',
  7.                     redirect_uri = 'http://localhost'
  8.                     )
  9. # Login to the session
  10. TDSession.login()
  11.  
  12.  
  13. # Create a streaming sesion
  14. TDStreamingClient = TDSession.create_streaming_session()
  15.  
  16.  
  17. TDStreamingClient.timesale(service = 'TIMESALE_EQUITY', symbols = ['AMZN'], fields = [0,1,2,3])
  18.  
  19.  
  20. for request in TDStreamingClient.data_requests['requests']:
  21.     print(type(request))
  22.     print('-'*80)
  23.  
  24. # Stream it.
  25. data = TDStreamingClient.stream()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top