Skip to content

About

platform to backtest trading algorithms

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

DummyTrader

A cryptocurrency trading bot with backtesting capabilities and live trading support. Built with FastAPI, Vue.js, and the CCXT library.

Features

  • 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

Prerequisites

  • Python 3.8+
  • Node.js 14+ (for development)
  • Binance account with API keys (for live trading)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/dummytrader.git
cd dummytrader
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables: Create a .env file 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

Running the Application

  1. Start the FastAPI server:
python -m uvicorn app.main:app --reload
  1. Open your browser and navigate to:
http://localhost:8000

Usage

Backtesting

  1. Select a trading strategy from the dropdown
  2. Choose trading pairs (up to 10 pairs)
  3. Set the timeframe(s)
  4. Adjust strategy parameters
  5. Click "Run Backtest"
  6. View results in the interactive charts

Live Trading

  1. Run a backtest to identify profitable pairs
  2. Click "Start Trading" on a successful backtest
  3. Monitor positions in the Live Trading Portal
  4. View real-time updates of:
    • Account balance
    • Active positions
    • Recent trades
    • P&L

Project Structure

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

Trading Strategies

Pairs Trading Strategy

  • Statistical arbitrage strategy
  • Trades correlated pairs
  • Parameters:
    • Lookback Window
    • Entry/Exit Thresholds
    • Stop Loss
    • Position Size
    • Trading Fees

Configuration

Risk Management

  • Take Profit: Default 2%
  • Stop Loss: Default 1%
  • Position Sizing: Configurable per strategy

Exchange Settings

  • Default: Binance
  • Mode: Spot Trading
  • Test Mode Available: Yes (Binance Testnet)

About

platform to backtest trading algorithms

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages