@stoqey/ib (Low-Level SDK)IBApiNext Reference
Built-in CLI Tools
Using the src/tools command-line utilities included with @stoqey/ib.
Command Line Tools Overview
The @stoqey/ib repository includes a full suite of pre-built CLI scripts in src/tools/ demonstrating how to interact with IBApiNext.
Build the project first to compile tools into ./dist/tools/:
yarn buildAvailable Tools & Usage Examples
Account Summary Tool (account-summary.js)
Prints live account balances and watches for changes:
node ./dist/tools/account-summary.js -group=All -tags="NetLiquidation,TotalCashValue,BuyingPower" -watch -port=7497Market Data Streaming Tool (market-data.js)
Streams real-time market data quotes for a stock or contract:
node ./dist/tools/market-data.js -symbol=AAPL -sectype=STK -exchange=SMART -currency=USD -port=7497Positions Viewer (positions.js)
Retrieves all open portfolio positions:
node ./dist/tools/positions.js -port=7497Contract Search Tool (search-contracts.js)
Searches TWS database for symbols matching a keyword:
node ./dist/tools/search-contracts.js -text=TESLA -port=7497Order Placement Tool (place-order.js)
Places a test order on paper trading account:
node ./dist/tools/place-order.js -symbol=AAPL -action=BUY -qty=1 -orderType=LMT -price=150 -port=7497Historical Data Downloader (historical-data.js)
Fetches historical candlestick bars:
node ./dist/tools/historical-data.js -symbol=MSFT -duration="1 D" -barsize="1 min" -port=7497