examples(node): add a live Binance trading example

Mirror examples/python/live_trading.py for the Node binding: connect to the
public Binance kline WebSocket, stream close prices through RSI / MACD /
Bollinger Bands, and print BUY/SELL candidate signals when all three agree.
The symbol and interval are validated before being spliced into the stream
URL, and non-kline frames (acks, heartbeats) are skipped.

Uses the standard `ws` package, added as a devDependency so it installs
with `npm install` for anyone running the examples but never reaches a
consumer of the published package.
This commit is contained in:
kingchenc
2026-05-22 22:45:52 +02:00
parent 2eabda5fa3
commit 25454fa89a
2 changed files with 162 additions and 1 deletions
+2 -1
View File
@@ -63,6 +63,7 @@
"test": "node --test __tests__/"
},
"devDependencies": {
"@napi-rs/cli": "^2.18.0"
"@napi-rs/cli": "^2.18.0",
"ws": "^8.18.0"
}
}