Commit 0521db7
committed
refactor: extract OHLCVDataProviderBase to eliminate duplication
Introduce an intermediate base class OHLCVDataProviderBase that handles
all shared OHLCV data provider logic:
- Constructor, copy(), get_data(), prepare_backtest_data(), get_backtest_data()
- CSV storage helpers, date range resolution, number of data points
- Fixes bug: create_start_date was missing from Yahoo/AV/Polygon providers
Concrete providers now only implement:
- market_name, timeframe_map (class attributes)
- _download_ohlcv() (API-specific download)
- _validate_symbol() (optional, Yahoo only)
Reduces Yahoo/AlphaVantage/Polygon from ~1,851 lines to ~1,033 total (44% reduction).
CCXT intentionally excluded (different pattern: exchange-based detection, pagination, ticker support).1 parent 45656c4 commit 0521db7
10 files changed
Lines changed: 630 additions & 1442 deletions
File tree
- investing_algorithm_framework
- infrastructure
- data_providers
- tests/infrastructure/data_providers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
0 commit comments