Skip to content

Instantly share code, notes, and snippets.

@jsanders
Created December 18, 2015 05:15
Show Gist options
  • Save jsanders/8f6efb8e515cab7c9f8d to your computer and use it in GitHub Desktop.
Save jsanders/8f6efb8e515cab7c9f8d to your computer and use it in GitHub Desktop.
Websockets in Stockastic
iex(5)> import Stockastic.Tickertape, only: [connect!: 2, loop!: 2]
nil
iex(6)> connect!("KAH40660714", "TYHBEX") |> loop!(fn(text) -> IO.puts(text) end)
{"ok":true,"quote":{"symbol":"PMI","venue":"TYHBEX","bid":7947,"bidSize":57,"askSize":0,"bidDepth":26743,"askDepth":0,"last":7617,"lastSize":92,"lastTrade":"2015-12-18T05:14:05.115858945Z","quoteTime":"2015-12-18T05:14:10.030310726Z"}}
{"ok":true,"quote":{"symbol":"PMI","venue":"TYHBEX","bid":7947,"bidSize":57,"askSize":0,"bidDepth":13400,"askDepth":0,"last":7617,"lastSize":92,"lastTrade":"2015-12-18T05:14:05.115858945Z","quoteTime":"2015-12-18T05:14:10.03139461Z"}}
{"ok":true,"quote":{"symbol":"PMI","venue":"TYHBEX","bid":7947,"bidSize":57,"askSize":0,"bidDepth":57,"askDepth":0,"last":7617,"lastSize":92,"lastTrade":"2015-12-18T05:14:05.115858945Z","quoteTime":"2015-12-18T05:14:10.032434757Z"}}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment