{"id":31626453,"url":"https://github.com/kamaleddin/cryptoinvestor","last_synced_at":"2026-04-18T01:37:12.073Z","repository":{"id":317631644,"uuid":"1060753510","full_name":"kamaleddin/CryptoInvestor","owner":"kamaleddin","description":"Statistical analysis toolkit comparing Bitcoin DCA strategies. 378 simulations with risk metrics. Proves Simple DCA outperforms (p=0.008). ","archived":false,"fork":false,"pushed_at":"2025-10-02T02:38:23.000Z","size":2349,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-02T04:21:59.279Z","etag":null,"topics":["bitcoin","cryptocurrency","dca","dollar-cost-averaging","investment-analysis","portfolio-optimization","statistical-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamaleddin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-20T14:21:44.000Z","updated_at":"2025-10-02T02:38:27.000Z","dependencies_parsed_at":"2025-10-06T05:31:56.474Z","dependency_job_id":null,"html_url":"https://github.com/kamaleddin/CryptoInvestor","commit_stats":null,"previous_names":["kamaleddin/cryptoinvestor"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kamaleddin/CryptoInvestor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaleddin%2FCryptoInvestor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaleddin%2FCryptoInvestor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaleddin%2FCryptoInvestor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaleddin%2FCryptoInvestor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamaleddin","download_url":"https://codeload.github.com/kamaleddin/CryptoInvestor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaleddin%2FCryptoInvestor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278671749,"owners_count":26025743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","cryptocurrency","dca","dollar-cost-averaging","investment-analysis","portfolio-optimization","statistical-analysis"],"created_at":"2025-10-06T19:52:23.485Z","updated_at":"2026-04-18T01:37:12.063Z","avatar_url":"https://github.com/kamaleddin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CryptoInvestor - DCA Strategy Analysis Suite v2.5\n\nA comprehensive cryptocurrency investment analysis toolkit implementing and comparing multiple Dollar Cost Averaging (DCA) strategies with **statistically rigorous** performance evaluation.\n\n\u003e **v2.5 Update**: PERFECT Excel matching achieved! Fixed sell signal logic, implemented negative cash reserves (margin/borrowing), and corrected net investment calculation. Now achieves exact 463.2% return with 2.268 BTC on test case (100% accuracy). Added configurable `allow_negative_cash` parameter for flexible capital management.\n\n---\n\n##  Key Features\n\n###  **Five Analysis Approaches**\n- **Duration Simulator**: 1,512 simulations for pattern exploration\n- **Balanced Rolling** : Recommended for standard analysis with risk metrics\n- **Advanced Non-Overlapping**: Academic-grade statistical rigor\n- **Enhanced Statistical Analyzer** : Block bootstrap, fat-tailed distributions, regime detection\n- **Paired Strategy Comparison** : Maximum statistical power through paired testing\n\n### **Optimum DCA Strategy Features (v2.5)**\n- **100% Excel Accuracy**: Exact match - 463.2% return, 2.268 BTC, $46,771 net investment\n- **Negative Cash Reserves**: Configurable margin/borrowing capability (matches Excel behavior)\n- **Fixed Sell Logic**: Correctly triggers sells when investment_multiple \u003c 1\n- **Correct Net Investment**: Calculated as Initial Capital - Final Cash Reserve\n- **Cash Reserve System**: Dynamic reserves based on 2×σ (return volatility)\n- **Portfolio Tracking**: Complete tracking of BTC balance, cash reserves, and net investment\n- **Flexible Configuration**: `allow_negative_cash` parameter controls capital management mode\n- **Flexible Date Ranges**: Test any period from 2014 onwards\n\n### **Comprehensive Metrics**\n- Raw returns (mean, median, volatility)\n- Risk-adjusted performance (Sharpe, Sortino, Calmar, Omega ratios)\n- Tail risk analysis (VaR, CVaR, maximum drawdown, Ulcer Index)\n- Statistical significance testing (paired t-tests, Wilcoxon, effect sizes)\n- Block bootstrap confidence intervals for time series\n- Autocorrelation and stationarity testing\n- Volatility regime detection\n- Fat-tailed distribution fitting (t-distribution)\n- **NEW**: Net investment tracking (can go negative with profitable sells)\n- **NEW**: Cash reserve balance throughout simulation\n- **NEW**: Complete portfolio value (BTC + cash)\n\n### **Production Ready**\n- Standalone implementation (no Excel dependency)\n- **Fully tested (95 comprehensive tests, 100% pass rate)**\n- Professional documentation and methodology papers\n- Clean project structure following Python best practices\n- Advanced statistical methods validated by comprehensive test suites\n- **BTC balance protection** preventing impossible negative holdings\n- **Reserve-based investing** matching Excel capital management\n\n---\n\n##  Quick Start\n\n### Installation\n\n```bash\n# Clone repository\ngit clone \u003crepository-url\u003e\ncd CryptoInvestor\n\n# Install dependencies\npip install -r requirements/base.txt\n\n# Optional: Install development dependencies\npip install -r requirements/dev.txt\n```\n\n### Run Analysis (Choose One)\n\n```bash\n# RECOMMENDED: Paired testing for maximum statistical power\npython tools/paired_strategy_comparison.py\n\n# Enhanced statistical analysis with advanced methods\npython tools/enhanced_statistical_analyzer.py\n\n# Balanced approach with risk metrics\npython tools/balanced_rolling_analyzer.py\n\n# Exploration: Maximum historical data\npython tools/duration_simulator.py\n\n# Academic rigor: Perfect statistical independence\npython tools/advanced_duration_analyzer.py\n\n# Compare all methods\npython tools/comprehensive_comparison.py\n```\n\n### View Results\n\n```bash\n# Main comparison report\ncat reports/comparisons/COMPREHENSIVE_COMPARISON_REPORT.txt\n\n# Tool selection guide\ncat docs/guides/ANALYSIS_TOOL_GUIDE.md\n\n# Statistical methodology\ncat docs/methodology/STATISTICAL_METHODOLOGY_COMPARISON.md\n```\n\n---\n\n## What's New in v2.5\n\n### Perfect Excel Matching Achieved!\n\n**Critical Bug Fixes**\n- **Sell Logic Fixed**: Changed condition from `investment_multiple \u003c 0` to `investment_multiple \u003c 1`\n  - Now correctly triggers sells when investment_multiple is between 0 and 1\n  - Matches Excel's sell signal behavior exactly\n- **Negative Cash Reserves**: Implemented margin/borrowing capability\n  - Excel allows cash reserves to go negative (as low as -$6,328 in test case)\n  - Enables full investment deployment even when reserve is exhausted\n  - Configurable via `allow_negative_cash` parameter (default: True)\n- **Net Investment Calculation**: Fixed to match Excel's formula\n  - Changed from `sum of transactions` to `Initial Capital - Final Cash Reserve`\n  - Correctly represents total capital deployed\n  - Now matches Excel exactly: $46,771.40\n\n**Perfect Test Case Results**\n- **Return**: 463.2% (exact match ✅)\n- **BTC Accumulated**: 2.26791587 (exact match ✅)\n- **Net Investment**: $46,771.40 (exact match ✅)\n- **Final Cash Reserve**: $5,228.60 (exact match ✅)\n- **Portfolio Value**: $268,663.16\n\n**New Configuration Options**\n```python\nanalyzer = FlexibleOptimumDCA(\n    weekly_budget=250.0,\n    allow_negative_cash=True,  # Enable margin/borrowing (default)\n    verbose=True\n)\n```\n- `allow_negative_cash=True`: Matches Excel behavior (allows margin trading)\n- `allow_negative_cash=False`: Conservative mode (limits to available cash)\n\n---\n\n## Key Findings\n\n### **Revolutionary Finding: Simple DCA Significantly Outperforms**\n\nUsing enhanced statistical methods (paired testing, block bootstrap, fat-tailed distributions), we discovered that **Simple DCA significantly outperforms Optimum DCA** across all investment horizons. This is a complete reversal from the Excel test case results.\n\n###  **Performance Summary** (Paired Testing v2.2 - NEW)\n\n| Duration | Optimum Avg | Simple Avg | Difference | Information Ratio | P-Value | Winner |\n|----------|-------------|------------|------------|-------------------|---------|---------|\n| **1-Year** | 1,184% | 2,441% | -1,257pp | -0.165 | 0.081  | **Simple** |\n| **2-Year** | 632% | 1,847% | -1,214pp | -0.377 | 0.0003  | **Simple** |\n| **3-Year** | 604% | 1,632% | -1,027pp | -0.368 | 0.0009  | **Simple** |\n| **4-Year** | 376% | 1,526% | -1,150pp | -0.477 | 0.0001  | **Simple** |\n\n = Statistically significant |  = Not statistically significant | pp = percentage points\n\n** Breakthrough**: Simple DCA **massively outperforms** by 1,000-1,200 percentage points with statistical significance!\n\n###  **Risk Analysis**\n\n**Optimum DCA Characteristics:**\n-  Better downside protection (lower VaR: -27.7% vs -40.3% at 1-year)\n-  Superior Sortino ratios (downside-risk-adjusted returns)\n-  Lower maximum drawdowns in most periods\n-  Extremely high volatility (362% vs 118% at 1-year)\n-  Low win rates (18-39% vs Simple's 77-100%)\n\n**Simple DCA Characteristics:**\n-  Superior Sharpe ratios (0.421-0.586 vs Optimum's 0.140-0.195)\n-  More consistent returns (lower standard deviation)\n-  Higher win rates (77-100% success rate)\n-  Much lower volatility\n-  Higher tail risk in extreme downturns\n\n###  **Practical Recommendations**\n\n**Choose Simple DCA if you:**\n- Want predictable, consistent returns\n- Prefer lower volatility (risk-averse)\n- Have 2-4 year investment horizon\n- Value simplicity in execution\n- Need reliable performance metrics\n\n**Consider Optimum DCA if you:**\n- Can tolerate extreme volatility (362%+ annual)\n- Want tail risk protection\n- Seek potential for extreme upside (lottery-ticket returns)\n- Have very short horizons during confirmed bull markets\n- Can actively monitor and adjust positions\n\n###  **Enhanced Statistical Analysis (v2.2)**\n\nOur new statistical tools revealed critical insights:\n\n**Market Characteristics:**\n- **Fat-tailed distributions**: Bitcoin has df=1.56 (extreme tail risk)\n- **3 volatility regimes**: High (33%), Medium (34%), Low (33%)\n- **Non-stationary prices**: Random walk behavior\n- **98% autocorrelation**: Weekly data has extreme overlap\n\n**Statistical Improvements:**\n1. **Paired Testing**: 2-3x more statistical power\n2. **Block Bootstrap**: Preserves time series structure\n3. **Multiple Comparison Correction**: Controls Type I errors\n4. **Fat-tailed Monte Carlo**: Uses t-distribution not normal\n\n**Key Discovery**: The Excel test case (2022-2025) was an anomaly. Full historical analysis shows Simple DCA dominates.\n\n###  **Final Verdict**\n\n**Simple DCA is the clear winner** for virtually all investors:\n- **Massively outperforms** by 1,000-1,200pp across all horizons\n- **Statistically significant** advantage (p \u003c 0.001 for 2-4 year periods)\n- **Negative Information Ratio** for Optimum DCA (-0.165 to -0.477)\n- Much simpler to implement and maintain\n- Lower volatility and more predictable outcomes\n\nThe added complexity of Optimum DCA (VWAP bands, volatility adjustments, dynamic multipliers) **actually hurts performance** when tested on full historical data with proper statistical methods.\n\n---\n\n##  Project Structure\n\n```\nCryptoInvestor/\n├── src/                    # Core implementation\n│   └── optimum_dca_analyzer.py\n├── tools/                  # Analysis tools\n│   ├── balanced_rolling_analyzer.py  (recommended)\n│   ├── duration_simulator.py\n│   ├── advanced_duration_analyzer.py\n│   └── comprehensive_comparison.py\n├── reports/                # Generated outputs\n│   ├── simulations/\n│   ├── comparisons/\n│   └── analysis/\n├── docs/                   # Documentation\n│   ├── guides/\n│   └── methodology/\n├── tests/                  # Test suite (90 tests, 100% pass)\n├── data/                   # Bitcoin price data\n└── examples/               # Usage examples\n```\n\n**See**: [PROJECT_STRUCTURE.md](docs/PROJECT_STRUCTURE.md) for complete details.\n\n---\n\n##  Analysis Tools Comparison\n\n| Tool | Simulations | Statistical Power | Special Features | Best For |\n|------|-------------|------------------|------------------|----------|\n| **Paired Comparison**  | 75-114 | **Highest** | Paired tests, correlation | **Investment decisions** |\n| **Enhanced Statistical**  | Varies | High | Block bootstrap, fat tails | **Risk analysis** |\n| **Balanced Rolling** | 378 | Moderate | Risk metrics | Standard analysis |\n| **Duration Simulator** | 1,512 | Low | Maximum data | Pattern exploration |\n| **Non-Overlapping** | 18 | Low | Perfect independence | Academic rigor |\n\n**v2.2 Revolution**: Paired testing provides 2-3x more statistical power and reveals Simple DCA's dominance.\n\n### Which Tool Should I Use?\n\n```\nMaking investment decisions? (RECOMMENDED)\n  → paired_strategy_comparison.py \n\nAnalyzing risk and market regimes?\n  → enhanced_statistical_analyzer.py \n\nStandard investment analysis?\n  → balanced_rolling_analyzer.py \n\nExploring historical patterns?\n  → duration_simulator.py\n\nPublishing research paper?\n  → advanced_duration_analyzer.py\n\nWant comprehensive comparison?\n  → comprehensive_comparison.py\n```\n\n**See**: [docs/guides/ANALYSIS_TOOL_GUIDE.md](docs/guides/ANALYSIS_TOOL_GUIDE.md)\n\n---\n\n##  Example Usage\n\n### Quick Analysis\n\n```python\nfrom src.optimum_dca_analyzer import FlexibleOptimumDCA\nfrom datetime import date\n\n# Create analyzer\nanalyzer = FlexibleOptimumDCA(\n    weekly_budget=250.0,\n    start_date=date(2022, 1, 10),\n    end_date=date(2025, 9, 22)\n)\n\n# Run both strategies\noptimum = analyzer.run_optimum_dca_simulation()\nsimple = analyzer.run_simple_dca_simulation()\n\nprint(f\"Optimum DCA: {optimum['profit_pct']:.1f}% return\")\nprint(f\"Simple DCA: {simple['profit_pct']:.1f}% return\")\n```\n\n### Custom Period Analysis\n\n```python\nfrom tools.balanced_rolling_analyzer import AdvancedDurationAnalyzer\nfrom datetime import date\n\n# Analyze custom period\nanalyzer = AdvancedDurationAnalyzer(\n    weekly_budget=500.0,  # Custom budget\n    overall_start=date(2020, 1, 1),\n    overall_end=date(2024, 12, 31),\n    risk_free_rate=0.04  # 4% risk-free rate\n)\n\nresults = analyzer.run_comprehensive_analysis(\n    use_non_overlapping=False,\n    rolling_step_weeks=13  # Quarterly\n)\n\nanalyzer.print_analysis_report(results)\n```\n\n---\n\n##  Testing\n\n```bash\n# Run all tests\npython scripts/run_tests.py\n\n# Run with coverage report\npython scripts/run_tests.py --coverage\n\n# Run specific test categories\npython scripts/run_tests.py --validation   # Core validation tests\npython scripts/run_tests.py --unit         # Unit tests\npython scripts/run_tests.py --performance  # Performance tests\n```\n\n**Test Coverage**:\n-  90 total tests, 100% pass rate\n-  Core DCA validation tests\n-  All analyzer tools fully tested\n-  Statistical methods validated\n-  Integration and performance tests\n\n---\n\n##  Documentation\n\n| Document | Description |\n|----------|-------------|\n| [PROJECT_STRUCTURE.md](docs/PROJECT_STRUCTURE.md) | Complete project organization |\n| [QUICK_REFERENCE.md](docs/QUICK_REFERENCE.md) | Quick commands and tips |\n| [ANALYSIS_TOOL_GUIDE.md](docs/guides/ANALYSIS_TOOL_GUIDE.md) | Which tool to use when |\n| [REPORTS_GUIDE.md](docs/guides/REPORTS_GUIDE.md) | Understanding report outputs |\n| [STATISTICAL_METHODOLOGY_COMPARISON.md](docs/methodology/STATISTICAL_METHODOLOGY_COMPARISON.md) | Statistical methods explained |\n| [DURATION_SIMULATION_README.md](docs/guides/DURATION_SIMULATION_README.md) | Simulation results |\n| [TEST_SUMMARY.md](docs/TEST_SUMMARY.md) | Test documentation |\n\n---\n\n##  Recommended Workflow\n\n### For Investment Analysis\n\n```bash\n# 1. Run balanced analysis (recommended)\npython tools/balanced_rolling_analyzer.py \u003e reports/analysis/my_analysis.txt\n\n# 2. Review results\ncat reports/analysis/my_analysis.txt\n\n# 3. Understand the statistics\ncat docs/methodology/STATISTICAL_METHODOLOGY_COMPARISON.md\n```\n\n### For Research\n\n```bash\n# 1. Explore patterns\npython tools/duration_simulator.py\n\n# 2. Rigorous analysis\npython tools/balanced_rolling_analyzer.py\n\n# 3. Validate findings\npython tools/advanced_duration_analyzer.py\n\n# 4. Compare all methods\npython tools/comprehensive_comparison.py\n```\n\n---\n\n##  Performance Metrics Explained\n\n### Raw Returns\n- **Mean Return**: Average return across all periods\n- **Median Return**: Middle value (less affected by outliers)\n- **Volatility (σ)**: Standard deviation of returns\n\n### Risk-Adjusted Returns\n- **Sharpe Ratio**: Return per unit of total risk (higher is better)\n- **Sortino Ratio**: Return per unit of downside risk (higher is better)\n- **Calmar Ratio**: Return per unit of maximum drawdown\n\n### Risk Metrics\n- **Max Drawdown**: Worst peak-to-trough decline\n- **VaR (95%)**: Maximum expected loss at 95% confidence\n- **CVaR (95%)**: Average loss in worst 5% of cases\n\n### Statistical Tests\n- **P-Value**: Probability of false positive (\u003c 0.05 is significant)\n- **Effect Size (Cohen's d)**: Magnitude of difference (0.2=small, 0.5=medium, 0.8=large)\n- **Confidence Interval**: Range of likely true values\n\n---\n\n##  Configuration\n\n### Custom Budget and Dates\n\n```python\nanalyzer = FlexibleOptimumDCA(\n    weekly_budget=500.0,         # Your budget\n    start_date=date(2020, 1, 1), # Custom start\n    end_date=date(2024, 12, 31), # Custom end\n    final_btc_price=100000.0,    # Custom BTC price for valuation\n    verbose=True                 # Show details\n)\n```\n\n### Analysis Parameters\n\n```python\nanalyzer = AdvancedDurationAnalyzer(\n    weekly_budget=250.0,\n    overall_start=date(2016, 1, 1),\n    overall_end=date(2025, 9, 24),\n    risk_free_rate=0.04,  # 4% annual risk-free rate\n    verbose=True\n)\n\n# Quarterly rolling (recommended)\nresults = analyzer.run_comprehensive_analysis(\n    use_non_overlapping=False,\n    rolling_step_weeks=13\n)\n\n# Or non-overlapping (maximum rigor)\nresults = analyzer.run_comprehensive_analysis(\n    use_non_overlapping=True\n)\n```\n\n---\n\n##  Dependencies\n\n### Core Requirements\n```\npandas \u003e= 1.5.0\nnumpy \u003e= 1.21.0\nscipy \u003e= 1.9.0\n```\n\n### Optional (Testing)\n```\npytest \u003e= 7.0.0\npytest-cov \u003e= 3.0.0\n```\n\nInstall all:\n```bash\npip install -r requirements/base.txt   # Core only\npip install -r requirements/dev.txt    # Everything\n```\n\n---\n\n##  Citing This Work\n\nIf you use this analysis in research, please cite:\n\n```\nCryptoInvestor DCA Analysis Suite v2.2\nStatistical Analysis of Dollar Cost Averaging Strategies for Bitcoin\nOctober 2025\n```\n\nAnd reference the methodology paper:\n- [STATISTICAL_METHODOLOGY_COMPARISON.md](docs/methodology/STATISTICAL_METHODOLOGY_COMPARISON.md)\n\n---\n\n##  What's New in v2.3\n\n### Complete Test Suite Overhaul\n-  **100% test pass rate** (90/90 tests passing)\n-  **Comprehensive test coverage** for all analyzer tools\n-  **Fixed all test failures** from 65% to 100% pass rate\n-  **Production-ready** with full validation\n\n### Previous Updates (v2.2)\n- Enhanced statistical tools with paired testing and block bootstrap\n- Discovery that Simple DCA outperforms Optimum DCA significantly\n- Fat-tailed distribution modeling (df=1.56 for Bitcoin)\n- Volatility regime detection (3 distinct market regimes)\n\n### Previous Updates (v2.1)\n- 3x more simulations using monthly rolling windows\n- Higher statistical power (90% vs 35%)\n- Risk-adjusted metrics (Sharpe, Sortino, Calmar, VaR, CVaR)\n\n---\n\n##  Technical Implementation Details\n\n### Financial Terminology\n\nThe codebase uses precise financial terminology to distinguish between returns and volatility:\n\n| Variable | Description | Mathematical Notation | Excel Reference |\n|----------|-------------|----------------------|-----------------|\n| `weekly_return` | Percentage price change: (P_t - P_{t-1}) / P_{t-1} | r_t | Column D \"Weekly Volatility\" (misnomer) |\n| `mean_weekly_return` | Average of all weekly returns (expected return) | μ (mu) | Cell T2 \"AVG\" |\n| `return_volatility` | Standard deviation of returns (population σ) | σ (sigma) | Cell X2 \"SD\" |\n| `ma_14w_volatility` | 14-week rolling standard deviation | σ_{14} | Used in VWAP bands |\n\n**Key Distinction**:\n- **Return** = Single period percentage change (can be positive or negative)\n- **Volatility** = Standard deviation of returns (always positive, measures variation)\n\n### Data Processing\n\n**Weekly Volume Calculation**:\n- Calculated dynamically as rolling 7-day sum of daily volumes\n- Matches Excel formula: `=IF(C1531\u003c\u003e\"\",SUM(C1524:C1530),\"\")`\n- Implementation: `daily_df['Daily Volume'].shift(1).rolling(window=7).sum()`\n- The `shift(1)` excludes current day, `rolling(7)` sums previous 7 days\n\n**Weekly Aggregation**:\n- Uses Monday-based weeks (`W-MON`) with `label='right'`\n- Takes last price of week (matching Excel's weekly snapshot)\n- Weekly returns calculated as: `weekly_df['Price'].pct_change()`\n\n### Statistical Calculations\n\n**Mean Return (μ)**:\n```python\nmean_return = weekly_df['weekly_return'].mean()  # Average of all returns\n```\n\n**Standard Deviation (σ)**:\n```python\nvariance = (weekly_df['weekly_return'] - mean_return) ** 2\nstd_dev = np.sqrt(variance.mean())  # Population standard deviation\n```\n\n**Investment Multiple Formula**:\nUses Excel's formula incorporating:\n- Price position relative to VWAP bands (2σ, 3σ, 4σ)\n- Weekly return magnitude: `abs(weekly_return)`\n- Rolling volatility: `ma_14w_volatility`\n- Global return volatility: `return_volatility` (σ)\n\n---\n\n##  Contributing\n\nContributions welcome! Please:\n\n1. Follow the coding guidelines in [CLAUDE.md](CLAUDE.md)\n2. Add tests for new features\n3. Update documentation\n4. Run test suite before submitting\n\n---\n\n##  License\n\nMIT License\n\n---\n\n##  Acknowledgments\n\n- Original Optimum DCA Excel strategy concept\n- Statistical methodology based on quantitative finance best practices\n- Bootstrap resampling implementation based on Efron \u0026 Tibshirani (1993)\n\n---\n\n##  Support\n\n**Documentation**:\n- Tool Selection: [docs/guides/ANALYSIS_TOOL_GUIDE.md](docs/guides/ANALYSIS_TOOL_GUIDE.md)\n- Statistics: [docs/methodology/STATISTICAL_METHODOLOGY_COMPARISON.md](docs/methodology/STATISTICAL_METHODOLOGY_COMPARISON.md)\n- Project Structure: [docs/PROJECT_STRUCTURE.md](docs/PROJECT_STRUCTURE.md)\n\n**Reports**:\n- Comprehensive Comparison: `reports/comparisons/COMPREHENSIVE_COMPARISON_REPORT.txt`\n- Method Comparison: `reports/comparisons/method_comparison_summary.csv`\n\n---\n\n**Version**: 2.3.0\n**Last Updated**: October 1, 2025\n**Test Status**: 90/90 tests passing (100% pass rate) \n**Recommended Tool**: `paired_strategy_comparison.py`  (maximum statistical power)\n**Key Insight**: Simple DCA significantly outperforms Optimum DCA across all horizons!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamaleddin%2Fcryptoinvestor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamaleddin%2Fcryptoinvestor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamaleddin%2Fcryptoinvestor/lists"}