MADE FOR US TRADERS - HARD TO FIND, FULLY COMPLIANT
This bot is specifically designed to meet US regulatory requirements:
- β SPOT TRADING ONLY (no futures, no derivatives)
- β LONG POSITIONS ONLY (no shorting)
- β NO LEVERAGE (100% compliant with US regulations)
- β US EXCHANGES ONLY (Binance US, Kraken US, ccxt-compatible US exchanges)
- β Regulatory Compliant for US retail traders
Why this matters: Most trading bots use leverage, futures, or shorting - which creates regulatory issues for US traders. This bot is built from the ground up for US compliance.
A sophisticated cryptocurrency trading bot implementing the famous Turtle Trading Strategy with modern enhancements, real-time web dashboard, and pyramid position management.
- Dual System Implementation: System 1 (20-day breakout) and System 2 (55-day breakout)
- Pyramid Position Management: Scale into positions with up to 4 units
- Dynamic Stop Loss: ATR-based stop loss management
- Risk Management: Position sizing based on account equity and volatility
- State Persistence: Automatic save/load of bot state for resilience
- Real-Time Updates: Live portfolio tracking via WebSocket
- Glassmorphism Design: Modern, professional UI with animated backgrounds
- Position Visualization: See all pyramid units, entry prices, and stop losses
- Bot Thinking Log: Watch the bot's decision-making process in real-time
- Performance Metrics: Win rate, profit factor, max drawdown, and more
- Trade History: Complete record of closed positions
- Exchange Integration: Built-in support for cryptocurrency exchanges
- JSON State Export: Export bot state for analysis
- Diagnostic Reports: Comprehensive system diagnostics
- Configuration Management: Easy-to-modify config.py
- Blocked Coins List: Avoid problematic trading pairs
- Clone the repository:
git clone https://github.com/Rors78/turtle-bot.git
cd turtle-bot- Install dependencies:
pip install -r requirements.txt- Configure your settings in
config.py:
- Set your exchange API keys
- Adjust risk parameters
- Configure trading systems
Terminal Mode:
python main.pyWeb Dashboard:
./launch_dashboard.shThe dashboard will automatically open at http://localhost:5001
The Turtle Trading System is a legendary trend-following strategy developed by Richard Dennis and William Eckhardt in the 1980s. This bot implements:
- Breakout Entry: Enter when price breaks above/below N-day high/low
- Pyramid Scaling: Add to winning positions at predetermined intervals
- ATR-based Stops: Volatility-adjusted stop losses
- Position Sizing: Risk-based position calculation using N (ATR)
turtle-bot/
βββ main.py # Main bot entry point
βββ config.py # Configuration settings
βββ requirements.txt # Python dependencies
βββ launch_dashboard.sh # Web dashboard launcher
βββ core/
β βββ position.py # Position management
β βββ turtle_engine.py # Core trading logic
βββ exchange/
β βββ base.py # Exchange integration
βββ misc/
β βββ strategies.json # Strategy configurations
β βββ turtlebot-icon.svg # Bot icon
βββ blocked_coins.json # Coins to avoid
βββ export_state_to_json.py # State export utility
βββ DIAGNOSTIC_REPORT.md # System diagnostics
βββ JSON_STATE_README.md # State format documentation
βββ WEB_DASHBOARD_README.md # Dashboard documentation
- Live portfolio value and P&L
- Active positions with pyramid visualization
- System 1 and System 2 status
- Connection status indicator
- Win rate with visual progress bar
- Profit factor calculation
- Total trades counter
- Maximum drawdown tracking
- Bot decision log with color-coded severity
- Entry/exit reasoning
- Stop loss hits and adjustments
- Error messages and warnings
Key settings in config.py:
# Trading Parameters
SYSTEM_1_PERIOD = 20 # Short-term breakout
SYSTEM_2_PERIOD = 55 # Long-term breakout
MAX_PYRAMID_UNITS = 4 # Maximum position size
ATR_MULTIPLIER = 2.0 # Stop loss distance
# Risk Management
RISK_PER_TRADE = 0.01 # 1% risk per trade
MAX_POSITIONS = 5 # Maximum concurrent positionsThe bot automatically tracks:
- Total P&L (realized and unrealized)
- Win/Loss ratio
- Profit factor
- Maximum drawdown
- Average trade duration
- System 1 vs System 2 performance
python export_state_to_json.pyConverts bot state to human-readable JSON format.
cat DIAGNOSTIC_REPORT.mdReview system health and performance diagnostics.
Built-in risk controls:
- Position size limits based on account equity
- Maximum concurrent positions
- ATR-based stop losses
- Correlation checks (avoid overexposure)
- Blocked coins list
- Emergency stop functionality
- Web Dashboard Guide - Complete dashboard documentation
- JSON State Format - State file structure
- Diagnostic Report - System diagnostics
This is a personal trading bot project. Feel free to fork and modify for your own use.
This bot is for educational and research purposes. Cryptocurrency trading carries significant risk. Always test thoroughly in paper trading mode before using real funds. Past performance does not guarantee future results.
This project is provided as-is for personal use and learning.
Built with the legendary Turtle Trading methodology π’