trading-bot
Installation
SKILL.md
Trading Bot — Signal-Driven Architecture
Build a trading bot that consumes live signals from SignalNGN via sn signals, executes trades via ledger trades add, and enforces risk management locally.
Architecture
sn signals --json → Bot Process → ledger trades add (trade recording)
↑ ↓ ↓
NATS stream Risk Management Loop ledger positions (state queries)
(periodic price check)
The bot is a single long-running process with two concurrent concerns:
- Signal loop — reads JSON lines from
sn signals --jsonstdout, decides whether to act, executes trades - Risk loop — periodically checks open positions against SL/TP/trailing stop/max hold time, closes positions that hit limits
Prerequisites: sn and ledger CLIs installed and configured. See the sn and ledger skills for setup. No other dependencies needed — sn provides signals AND live prices, ledger provides trade recording AND position queries.