{"session":"SESSION_VALUE_HERE"}
{"message":"waiting for session"}
{ "session": "aeccc9d7515398c50fa894d967d099b1", "iserver": {, "tickle": true,, "authStatus": {, "authenticated": true,, "competing": false,, "message": "",, "MAC": "98:F2:B3:23:CF:10" } } }
{"session":"aeccc9d7515398c50fa894d967d099b1"}
{"topic":"sts","args":{"authenticated":true}} {"topic":"system","success":"username"}
Topic | Definition |
---|---|
Solicated Message Types | |
smd+conidex / umd+conidex | market data + contract identifier and optional exchange |
smh+conid / umh+serverId | market data history + server identifier |
sor / uor | live orders |
str / utr | trades |
spl / upl | profit and loss |
ech+hb | echo + heartbeat |
tic | ping session |
Unsolicated Message Types | |
system | system connection |
sts | status |
ntf | notification |
blt | bulletin |
wss:// 
ws.send('smd+265598+{"fields":["31","83"]}');
{ "31": "382.89", "83": 0.04, "6119": "q6", "server_id": "q6", "conid": 265598, "_updated": 1593524408296, "topic": "smd+265598", }
ws.send('umd+265598+{}');
params | definition | valid values |
---|---|---|
String exchange | listing exchange | valid exchange the contract trades |
String period | duration of time back | {1-30}min, {1-8}h, {1-1000}d, {1-792}w, {1-182}m, {1-15}y |
String bar | data granularity | 1min, 2min, 3min, 5min, 10min, 15min, 30min, 1h, 2h, 3h, 4h, 8h, 1d, 1w, 1m |
Boolean outsideRth | outside regular trading hours | true/false |
String source | The type of data received |
|
String format | historical values returned | Can specify multiple separated by forward slash e.g. %o/%c
|
ws.send('smh+265598+{"exchange":"ISLAND","period":"2h","bar":"5min","outsideRth":false,"source":"t","format":"%h/%l"}');
{ "serverId": "341115", "symbol": "AAPL", "text": "AAPLE INC", "priceFactor": 100, "startTime": "20210317-18:00:00", "high": "12586/14469/65", "low": "12283/34103/0", "timePeriod": "7200s", "barLength": 300, "mdAvailability": "S", "mktDataDelay": 0, "outsideRth": false, "volumeFactor": 1, "priceDisplayRule": 1, "priceDisplayValue": "2", "negativeCapable": false, "messageVersion": 2, "data": [...], "points": 23, "topic": "smh+265598", }
ws.send('umh+341115');
ws.send('sor+{}');
{ "topic": "sor" , "args": [ { "acct": "DU1234", "conid": 265598, "orderId": 922048212, "cashCcy": "USD", "sizeAndFills": "0/1", "orderDesc": "Buy 100 Limit 372.00 GTC", "description1": "AAPL", "ticker": "AAPL", "secType": "STK", "listingExchange": "NASDAQ.NMS", "remainingQuantity": 100.0, "filledQuantity": 0.0, "companyName": "APPLE INC", "status": "Submitted", "origOrderType": "LIMIT", "supportsTaxOpt": "1", "lastExecutionTime": "200708173551", "lastExecutionTime_r": 1594229751000, "orderType": "Limit", "side": "BUY", "timeInForce": "GTC", "price": 372, "bgColor": "#000000", "fgColor": "#00F000" } ] }
ws.send('uor+{}');
{ "topic": "sor" , "args": [ { "acct": "DU1234", "orderId": 352055828, "status": "PendingSubmit", "fgColor": "#3399CC" }, { "acct": "DU1234", "orderId": 352055828, "status": "PreSubmitted", "bgColor": "#FFFFFF", "fgColor": "#0000CC" }, { "acct": "DU1234", "orderId": 352055828, "status": "Submitted", "bgColor": "#000000", "fgColor": "#00F000" } ] }
{ "topic": "sor" , "args": [ { "acct": "DU1234", "orderId": 352055828, "sizeAndFills": "100/622", "remainingQuantity": 622.0, "filledQuantity": 100.0, "avgPrice": "382.45", }, { "acct": "DU1234", "orderId": 352055828, "sizeAndFills": "700/22", "remainingQuantity": 22.0, "filledQuantity": 700.0, }, { "acct": "DU1234", "orderId": 352055828, "sizeAndFills": "722", "orderDesc": "Sold 722 Limit 382.40 GTC", "remainingQuantity": 0.0, "filledQuantity": 722.0, "status": "Filled", "timeInForce": "GTC", "price": 382.4, "bgColor": "#FFFFFF", "fgColor": "#000000" } ] }
ws.send('str+{}');
ws.send('str+{ "days": 1 }');
ws.send('str+{ "realtimeUpdatesOnly": true }');
{ "topic": "str" , "args": [ { "execution_id": "0000e0d5.60cf1bd1.01.01", "symbol": "AAPL", "supports_tax_opt": "1", "side": "B", "order_description": "Bot 1 @ 130.64 on ISLAND", "trade_time": "20210408-22:10:01", "trade_time_r": 1617919801000, "size": 1, "price": "130.64", "order_ref": "66807500", "submitter": "apara428", "exchange": "ISLAND", "commission": "0.35", "net_amount": 130.64, "account": "DU26214", "accountCode": "DU26214", "company_name": "APPLE INC", "contract_description_1": "AAPL", "sec_type": "STK", "listing_exchange": "NASDAQ.NMS", "conid": "265598", "conidex": "265598", "clearing_id": "IB", "clearing_name": "IB", "liquidation_trade": "0" } ] }
ws.send('utr+{}');
ws.send('spl+{}');
{ "topic": "spl" , "args": { "DU1234.Core": { "rowType":1, "dpl":-57520.0 "upl":972100.0 } } }
ws.send('upl{}');
ws.send('ech+hb');
ech+hb
ws.send('tic');
{ "topic": "tic", "alive": true, "id": "ee2e7cefefaad3d03b439ec1d2e9b5b7", "lastAccessed": 1616098376569, }
{ "topic": "system" , "success": "user123" } { "topic": "system" , "hb": 1594677336001 }
{ "topic": "sts" , "args": { "authenticated": true } { "topic": "sts" , "args": { "competing": false } }
{ "topic": "ntf" , "args": { "id": INDICATIVE_DATA_SUGGESTION , "text": "CFD quotes reference the trade, volume and bid/ask market data on the underlying STK" , "title": "Warning" , "url": "https://interactivebrokers.com/" } }
{ "topic": "blt" , "args": [ "id": "" , "message": "" ] }