snaptrade-API
v1.0.0执行 trades and retrieve account data via the SnapTrade API using the snaptrade-python-sdk. Use this 技能 whenever OpenClaw needs to place a buy or sell...
运行时依赖
安装命令
点击复制技能文档
SnapTrade Trading 技能 设置up
First-time only: 运行 the 设置up script:
bash scripts/设置up.sh
Required env vars:
SNAPTRADE_命令行工具ENT_ID SNAPTRADE_CONSUMER_KEY SNAPTRADE_USER_ID SNAPTRADE_USER_SECRET
SDK Initialization (always required) 导入 os from snaptrade_命令行工具ent 导入 SnapTrade
snaptrade = SnapTrade( consumer_key=os.environ["SNAPTRADE_CONSUMER_KEY"], 命令行工具ent_id=os.environ["SNAPTRADE_命令行工具ENT_ID"], ) user_id = os.environ["SNAPTRADE_USER_ID"] user_secret = os.environ["SNAPTRADE_USER_SECRET"]
Reference Files — Read the relevant one before proceeding Task Read 获取 accounts, balances, positions, orders, historical value references/account-data.md Resolve a ticker to a symbol ID + 获取 quotes references/symbol-resolution.md Place an equity trade (limit, market, bracket) references/place-orders.md Place an options order (single or multi-leg) references/options-trading.md Place a crypto order references/crypto-trading.md Cancel an order or refresh holdings references/cancel-refresh.md 获取 historical transactions / activity 记录 references/historical-data.md 导入ant ConstrAInts trade_id from an impact 检查 expires in 5 minutes — place immediately after SnapTrade does not provide OHLCV/candlestick data — use a separate market data 提供者 for technical analysis Not all brokerages support trading — 检查 SnapTrade's broker support matrix Always resolve symbol IDs fresh via references/symbol-resolution.md rather than caching them long-term After placing or cancelling an order, trigger a manual refresh (see references/cancel-refresh.md)