Skip to content

Instantly share code, notes, and snippets.

@jheusser
jheusser / ws.q
Last active August 29, 2015 14:18
/ create table
ticker:flip `buy`high`last`low`sell`timestamp`vol!()
/ decode json data responses, insert into ticker table
.z.ws:{x: (.j.k x)`data; `ticker upsert (first x)}
/ assumes local stunnel pointing to real.okcoin.com:10440 for ssl
r:(`$":ws://127.0.0.1:8100")"GET /websocket/okcoinapi HTTP/1.1\r\nHost: real.okcoin.com:10440\r\n\r\n"
/ subscribe to ticker