Crypto Price Alerter
Fetch live cryptocurrency prices and technical indicators via CoinGecko free API.
Quick Usage
uv run python scripts/price_check.py --symbol BTC --currency USD
uv run python scripts/price_check.py --symbol ETH --currency USD --upper 4000 --lower 2000
uv run python scripts/price_check.py --symbol SOL --currency USD --output json
Core Features
- Current Price — Live price, 24h change %, 24h volume, market cap
- Technical Indicators — SMA(7), SMA(21), RSI(14) from 30-day historical data
- Key Levels — 30-day resistance and support
- Price Alerts — Triggered when 24h change >5% or price crosses user thresholds
- JSON output — For automation pipelines:
--output json
Scripts
scripts/price_check.py— Main script. Run standalone withuv run python scripts/price_check.py [args]
Arguments
| Arg | Description |
|-----|-------------|
| --symbol | Crypto symbol (e.g. BTC, ETH, SOL) — required |
| --currency | Fiat currency (default: USD) |
| --upper | Upper price threshold for alert |
| --lower | Lower price threshold for alert |
| --days | Historical days for SMA (default: 30) |
| --output | text (default) or json |
Technical Signals
See references/signals.md for explanation of SMA, RSI, support/resistance, and trading signal interpretation.
Alert Logic
- 24h change > +5% → Bullish alert
- 24h change < -5% → Bearish alert
- Price >=
--upperthreshold → Price ceiling alert - Price <=
--lowerthreshold → Price floor alert
微信扫一扫