A cryptocurrency trading bot with backtesting capabilities and live trading support. Built with FastAPI, Vue.js, and the CCXT library.
- Backtesting Engine: Test trading strategies against historical data
- Live Trading: Execute trades in real-time on supported exchanges
- Web Interface: Modern, responsive UI for monitoring and control
- Multiple Strategies: Support for various trading strategies including:
- Pairs Trading (Statistical Arbitrage)
- More strategies can be added easily
- Risk Management: Built-in take profit and stop loss functionality
- Real-time Updates: WebSocket integration for live market data and position updates
- Python 3.8+
- Node.js 14+ (for development)
- Binance account with API keys (for live trading)
- Clone the repository:
git clone https://github.com/yourusername/dummytrader.git
cd dummytrader- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
Create a
.envfile in the root directory with the following:
BINANCE_API_KEY=your_api_key
BINANCE_API_SECRET=your_api_secret
BINANCE_TESTNET_API_KEY=your_testnet_api_key
BINANCE_TESTNET_API_SECRET=your_testnet_api_secret- Start the FastAPI server:
python -m uvicorn app.main:app --reload- Open your browser and navigate to:
http://localhost:8000
- Select a trading strategy from the dropdown
- Choose trading pairs (up to 10 pairs)
- Set the timeframe(s)
- Adjust strategy parameters
- Click "Run Backtest"
- View results in the interactive charts
- Run a backtest to identify profitable pairs
- Click "Start Trading" on a successful backtest
- Monitor positions in the Live Trading Portal
- View real-time updates of:
- Account balance
- Active positions
- Recent trades
- P&L
dummytrader/
├── app/
│ ├── main.py # FastAPI application
│ ├── strategies/ # Trading strategies
│ └── templates/ # HTML templates
├── config/
│ └── trading_config.py # Trading configuration
├── analysis/
│ └── backtest.py # Backtesting engine
├── requirements.txt
└── README.md
- Statistical arbitrage strategy
- Trades correlated pairs
- Parameters:
- Lookback Window
- Entry/Exit Thresholds
- Stop Loss
- Position Size
- Trading Fees
- Take Profit: Default 2%
- Stop Loss: Default 1%
- Position Sizing: Configurable per strategy
- Default: Binance
- Mode: Spot Trading
- Test Mode Available: Yes (Binance Testnet)