
gittech. site
for different kinds of informations and explorations.
Crypto DCA Analyzer
Crypto DCA Calculator
A Python tool for analyzing Dollar Cost Averaging (DCA) investment strategies for cryptocurrencies. Supports multiple trading pairs, custom buy frequencies, and provides detailed performance metrics and visualizations.
π Features
β
Fetch historical price data from various exchanges (default: Binance)
β
Multi-asset DCA simulation with custom allocations
β
Flexible investment schedules (daily, weekly, biweekly, monthly)
β
In-depth performance analysis per asset
β
Comprehensive portfolio metrics with Fear Index tracking
β
Visual insights via price and P&L charts
β
Intuitive CLI output with progress indicators
π Requirements
Install the following dependencies:
pip install -r requirements.txt
pandas>=2.1.0
matplotlib>=3.8.0
ccxt>=4.1.13
rich>=13.7.0
numpy>=1.24.0
π― Usage
Basic DCA for a single pair
python dca_btc.py --daily-investment 10 --pairs BTC/USDT:100
Multi-asset DCA with custom allocations
python dca_btc.py --daily-investment 100 --pairs BTC/USDT:80 ETH/USDT:20
Weekly investment
python dca_btc.py --daily-investment 100 --pairs BTC/USDT:60 ETH/USDT:30 SOL/USDT:10 --buy-period 1w
Advanced options
python dca_btc.py --start-date 2020-01-01 --end-date 2023-12-31 --daily-investment 100 \
--pairs BTC/USDT:50 ETH/USDT:30 DOT/USDT:20 \
--exchange binance --buy-period 2w
π Arguments
| Argument | Description |
| -- | |
| --start-date
| Start date in YYYY-MM-DD
format |
| --end-date
| End date in YYYY-MM-DD
format |
| --last-days
| Number of recent days to analyze |
| --daily-investment
| Daily investment amount in USD |
| --exchange
| Exchange to fetch data from (default: Binance) |
| --pairs
| Trading pairs with allocation percentages (e.g., BTC/USDT:80 ETH/USDT:20
) |
| --buy-period
| Investment frequency (1d=daily
, 1w=weekly
, 2w=biweekly
, 1m=monthly
) |
| --plot-type
| Chart output: 'all'
, 'total'
, or 'both'
|
π Output & Reports
1οΈβ£ Console Summary
Each run provides a detailed breakdown of your investments:
- π Total Invested & Current Value
- π’ Accumulated Crypto Amounts
- π Net Profit/Loss & PNL%
- π Fear Index (days in negative returns)
- π΅ Cost Basis vs. Market Price
- π Historic Highs & Lows with Dates
2οΈβ£ Visual Reports (Saved to /dca/
directory)
- Individual Asset Performance Charts π
- Total Portfolio Performance Graph π
- Investment vs. Market Trends π
π Example Commands
Invest $100 daily, 80% BTC & 20% ETH
python dca_btc.py --daily-investment 100 --pairs BTC/USDT:80 ETH/USDT:20
Weekly $500 DCA across 3 assets
python dca_btc.py --daily-investment 500 --pairs BTC/USDT:50 ETH/USDT:30 SOL/USDT:20 --buy-period 1w
Monthly $1000 BTC investment
python dca_btc.py --daily-investment 1000 --pairs BTC/USDT:100 --buy-period 1m
Generate only the total portfolio chart
python dca_btc.py --daily-investment 200 --pairs BTC/USDT:40 ETH/USDT:40 SOL/USDT:20 --plot-type total
π€ Contributing
Pull requests and contributions are welcome! Feel free to open issues for improvements.
π License
This project is open-source under the MIT License.