Add comprehensive cryptocurrency statistical analysis tool #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add comprehensive cryptocurrency statistical analysis tool
Summary
This PR implements a comprehensive Python script (
crypto_stats.py) for generating statistical insights for cryptocurrency tickers, building on the existing TickerDataLoader infrastructure from PR #2. The tool provides flexible ticker selection (single, multiple, or 'all'), optional date range filtering, and calculates a comprehensive set of statistical indicators including basic statistics, return analysis, volume metrics, and technical indicators.Key Features:
--start-dateand--end-dateparameters (YYYY-MM-DD format)Review & Testing Checklist for Human
Verify statistical calculation accuracy: The script implements manual fallback calculations for RSI, MACD, and Bollinger Bands due to pandas_ta/numpy compatibility issues. Please verify these calculations are mathematically correct by comparing outputs with known reference implementations or financial data sources.
Test performance with large datasets: Run
python crypto_stats.py all --start-date 2018-04-07 --end-date 2018-04-09to verify the tool can handle processing all tickers over multiple days without memory issues or excessive runtime.Validate edge case handling: Test scenarios like insufficient data for technical indicators (
python crypto_stats.py QTUMUSDT --start-date 2018-04-06 --end-date 2018-04-06), invalid date ranges, and verify error messages are clear and the tool doesn't crash.Recommended End-to-End Test Plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TD CLI["crypto_stats.py<br/>(Main Script)"]:::major-edit TestSuite["test_crypto_stats.py<br/>(Test Suite)"]:::major-edit DataLoader["reading-src/read_ticker.py<br/>(TickerDataLoader)"]:::context DataDir["data/<br/>(Ticker Data)"]:::context CLI --> DataLoader DataLoader --> DataDir TestSuite --> CLI CLI --> StatsCalc["Statistical Calculations<br/>(Basic + Technical)"]:::major-edit CLI --> ErrorHandling["Error Handling<br/>(Validation + Fallbacks)"]:::major-edit CLI --> OutputFormat["Formatted Output<br/>(Structured Reports)"]:::major-edit subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
Link to Devin run: https://app.devin.ai/sessions/851e775359d94b339a340c39d2f85b96
Requested by: @Nucs