Skip to content

Commit 09aef25

Browse files
committed
feat: add Yahoo Finance OHLCV data provider (#469)
- Add YahooOHLCVDataProvider class for stocks, ETFs, indices, forex, and crypto - Support market='YAHOO' in DataSource to auto-select Yahoo provider - Implement has_data, get_data, prepare_backtest_data, get_backtest_data, copy - Map framework TimeFrame values to yfinance intervals - Register as default data provider alongside CCXT - Add comprehensive unit tests with mocked yfinance
1 parent 54829a7 commit 09aef25

7 files changed

Lines changed: 833 additions & 4 deletions

File tree

investing_algorithm_framework/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from .infrastructure import AzureBlobStorageStateHandler, \
2929
CSVOHLCVDataProvider, CSVTickerDataProvider, \
3030
CCXTOHLCVDataProvider, CCXTTickerDataProvider, \
31-
PandasOHLCVDataProvider, \
31+
PandasOHLCVDataProvider, YahooOHLCVDataProvider, \
3232
AWSS3StorageStateHandler
3333
from .create_app import create_app
3434
from .download_data import download, download_v2, DownloadResult, \
@@ -116,6 +116,7 @@
116116
'CSVTickerDataProvider',
117117
"CCXTOHLCVDataProvider",
118118
"CCXTTickerDataProvider",
119+
"YahooOHLCVDataProvider",
119120
"DataProvider",
120121
"get_annual_volatility",
121122
"get_sortino_ratio",

investing_algorithm_framework/infrastructure/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
from .data_providers import CSVOHLCVDataProvider, \
1414
CSVTickerDataProvider, get_default_data_providers, \
1515
get_default_ohlcv_data_providers, CCXTOHLCVDataProvider, \
16-
CCXTTickerDataProvider, PandasOHLCVDataProvider
16+
CCXTTickerDataProvider, PandasOHLCVDataProvider, \
17+
YahooOHLCVDataProvider
1718
from .order_executors import CCXTOrderExecutor, BacktestOrderExecutor
1819
from .portfolio_providers import CCXTPortfolioProvider
1920

@@ -51,5 +52,6 @@
5152
"CCXTTickerDataProvider",
5253
"BacktestOrderExecutor",
5354
"PandasOHLCVDataProvider",
55+
"YahooOHLCVDataProvider",
5456
"BacktestService",
5557
]

investing_algorithm_framework/infrastructure/data_providers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .ccxt import CCXTOHLCVDataProvider, CCXTTickerDataProvider
22
from .csv import CSVOHLCVDataProvider, CSVTickerDataProvider
33
from .pandas import PandasOHLCVDataProvider
4+
from .yahoo import YahooOHLCVDataProvider
45

56

67
def get_default_data_providers():
@@ -13,6 +14,7 @@ def get_default_data_providers():
1314
return [
1415
CCXTOHLCVDataProvider(),
1516
CCXTTickerDataProvider(),
17+
YahooOHLCVDataProvider(),
1618
]
1719

1820

@@ -25,6 +27,7 @@ def get_default_ohlcv_data_providers():
2527
"""
2628
return [
2729
CCXTOHLCVDataProvider(),
30+
YahooOHLCVDataProvider(),
2831
]
2932

3033

@@ -36,4 +39,5 @@ def get_default_ohlcv_data_providers():
3639
'get_default_data_providers',
3740
'get_default_ohlcv_data_providers',
3841
'PandasOHLCVDataProvider',
42+
'YahooOHLCVDataProvider',
3943
]

0 commit comments

Comments
 (0)