Skip to content

Commit 45656c4

Browse files
committed
feat: add Alpha Vantage and Polygon.io OHLCV data providers (#469)
- Add AlphaVantageOHLCVDataProvider (market='ALPHA_VANTAGE') with API key via MarketCredential - Add PolygonOHLCVDataProvider (market='POLYGON') with API key via MarketCredential - Both follow same pattern as Yahoo/CCXT: auto-selected based on market value - Add alpha_vantage and polygon-api-client dependencies - Register both as default data providers - Add comprehensive unit tests (32 tests with mocked external calls)
1 parent 09aef25 commit 45656c4

8 files changed

Lines changed: 1802 additions & 1 deletion

File tree

investing_algorithm_framework/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
CSVOHLCVDataProvider, CSVTickerDataProvider, \
3030
CCXTOHLCVDataProvider, CCXTTickerDataProvider, \
3131
PandasOHLCVDataProvider, YahooOHLCVDataProvider, \
32+
AlphaVantageOHLCVDataProvider, PolygonOHLCVDataProvider, \
3233
AWSS3StorageStateHandler
3334
from .create_app import create_app
3435
from .download_data import download, download_v2, DownloadResult, \
@@ -117,6 +118,8 @@
117118
"CCXTOHLCVDataProvider",
118119
"CCXTTickerDataProvider",
119120
"YahooOHLCVDataProvider",
121+
"AlphaVantageOHLCVDataProvider",
122+
"PolygonOHLCVDataProvider",
120123
"DataProvider",
121124
"get_annual_volatility",
122125
"get_sortino_ratio",

investing_algorithm_framework/infrastructure/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
CSVTickerDataProvider, get_default_data_providers, \
1515
get_default_ohlcv_data_providers, CCXTOHLCVDataProvider, \
1616
CCXTTickerDataProvider, PandasOHLCVDataProvider, \
17-
YahooOHLCVDataProvider
17+
YahooOHLCVDataProvider, AlphaVantageOHLCVDataProvider, \
18+
PolygonOHLCVDataProvider
1819
from .order_executors import CCXTOrderExecutor, BacktestOrderExecutor
1920
from .portfolio_providers import CCXTPortfolioProvider
2021

@@ -53,5 +54,7 @@
5354
"BacktestOrderExecutor",
5455
"PandasOHLCVDataProvider",
5556
"YahooOHLCVDataProvider",
57+
"AlphaVantageOHLCVDataProvider",
58+
"PolygonOHLCVDataProvider",
5659
"BacktestService",
5760
]

investing_algorithm_framework/infrastructure/data_providers/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from .csv import CSVOHLCVDataProvider, CSVTickerDataProvider
33
from .pandas import PandasOHLCVDataProvider
44
from .yahoo import YahooOHLCVDataProvider
5+
from .alpha_vantage import AlphaVantageOHLCVDataProvider
6+
from .polygon import PolygonOHLCVDataProvider
57

68

79
def get_default_data_providers():
@@ -15,6 +17,8 @@ def get_default_data_providers():
1517
CCXTOHLCVDataProvider(),
1618
CCXTTickerDataProvider(),
1719
YahooOHLCVDataProvider(),
20+
AlphaVantageOHLCVDataProvider(),
21+
PolygonOHLCVDataProvider(),
1822
]
1923

2024

@@ -28,6 +32,8 @@ def get_default_ohlcv_data_providers():
2832
return [
2933
CCXTOHLCVDataProvider(),
3034
YahooOHLCVDataProvider(),
35+
AlphaVantageOHLCVDataProvider(),
36+
PolygonOHLCVDataProvider(),
3137
]
3238

3339

@@ -40,4 +46,6 @@ def get_default_ohlcv_data_providers():
4046
'get_default_ohlcv_data_providers',
4147
'PandasOHLCVDataProvider',
4248
'YahooOHLCVDataProvider',
49+
'AlphaVantageOHLCVDataProvider',
50+
'PolygonOHLCVDataProvider',
4351
]

0 commit comments

Comments
 (0)