Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.49 KB

File metadata and controls

52 lines (35 loc) · 1.49 KB

Bitcoin Trading Simulation

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.

Features

  • 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.

Installation

  1. Clone the repository.
  2. Install the required dependencies:
pip install -r requirements.txt

Usage

Run the simulation script:

python bitcoin_trading_simulation.py

Options

Customize 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 --quiet

Tests

Run the test suite:

pytest