A Python-based CLI tool that simulates Bitcoin trading using a 'Golden Cross' moving average strategy. It generates synthetic price data using Geometric Brownian Motion, executes trades based on technical indicators, and provides a daily ledger with a final performance summary.
- Price Simulation: Uses Geometric Brownian Motion to simulate 60 days of Bitcoin prices.
- Trading Strategy: Implements a Golden Cross strategy (Short MA > Long MA = Buy, Short MA < Long MA = Sell).
- Rich CLI Output: features color-coded logs (Green for Buy/Profit, Red for Sell/Loss) and emojis for better readability.
- Performance metrics: Compares the strategy's performance against a "Buy and Hold" approach.
- Clone the repository.
- Install the required dependencies:
pip install -r requirements.txtRun the simulation script:
python bitcoin_trading_simulation.pyCustomize the simulation with the following arguments:
--days [int]: Number of days to simulate (default: 60)--initial-price [float]: Initial Bitcoin price (default: 50000)--volatility [float]: Volatility factor (default: 0.02)--initial-cash [float]: Initial cash available (default: 10000)--quiet: Suppress daily ledger output--no-color: Disable colored output
Example:
python bitcoin_trading_simulation.py --days 100 --initial-cash 5000 --quietRun the test suite:
pytest