End-to-end implementation from the guide — Python + Binance Testnet + Claude AI filter.
Signal Layer strategy.py EMA50 trend + RSI momentum + ATR volatility
Filter Layer ai_filter.py Claude validates each signal before execution
Execution Layer executor.py Binance API — market buy + OCO sell
Risk Layer risk_manager.py Position sizing, drawdown limits, loss streaks
Analytics backtester.py Candle-by-candle simulation + charts
dashboard.py Live Streamlit monitoring dashboard
Config config.py All tunable parameters in one place
Entry Point bot.py CLI: --download | --backtest | --live
pip install -r requirements.txt# Windows
set BINANCE_API_KEY=your_testnet_key
set BINANCE_API_SECRET=your_testnet_secret
set ANTHROPIC_API_KEY=your_anthropic_key
# macOS/Linux
export BINANCE_API_KEY=your_testnet_key
export BINANCE_API_SECRET=your_testnet_secret
export ANTHROPIC_API_KEY=your_anthropic_keypython bot.py --downloadpython bot.py --backteststreamlit run dashboard.pypython bot.py --livetrading_bot/
├── config.py All parameters — edit here first
├── strategy.py EMA, RSI, ATR indicators + signal logic
├── ai_filter.py Claude API validation layer
├── risk_manager.py Position sizing + safety guards
├── executor.py Binance API calls
├── backtester.py Historical simulation + charts
├── dashboard.py Streamlit live dashboard
├── bot.py Main entry point (CLI)
├── requirements.txt
└── data/ Created automatically
├── historical_data.csv
├── trades.csv
├── bot.log
└── backtest_results.png
| Rule | Default |
|---|---|
| Risk per trade | 2% |
| Max daily drawdown | 5% |
| Max consecutive losses | 3 |
| Min Risk:Reward | 1:2 |
- Always start on Testnet —
USE_TESTNET = Truein config.py - Never commit API keys — use environment variables
- Disable withdrawals on your Binance API key
- Paper trade for at least 30 days before going live