FinancialData.Net feed for Backtrader
Asset Class
API Endpoint
stock
get_stock_prices
international_stock
get_international_stock_prices
etf
get_etf_prices
commodity
get_commodity_prices
otc
get_otc_prices
crypto
get_crypto_prices
forex
get_forex_prices
Asset Class
API Endpoint
stock / etf
get_minute_prices
crypto
get_crypto_minute_prices
forex
get_forex_minute_prices
pip install backtrader fdnpy
import datetime as dt
import backtrader as bt
from feeds import FinancialDataNetData
cerebro = bt .Cerebro ()
data = FinancialDataNetData (
symbol = 'AAPL' ,
api_key = 'YOUR_API_KEY' ,
asset_class = 'stock' ,
timeframe = bt .TimeFrame .Days ,
fromdate = dt .datetime (2020 , 1 , 1 ),
todate = dt .datetime (2025 , 12 , 31 ),
)
cerebro .adddata (data )
cerebro .run ()
cerebro .plot ()
Resampling: Only 1-day and 1-minute bars are natively supported. Use Backtrader resampling for other timeframes.
Pagination: Historical minute queries are fetched day-by-day because the API endpoints are date-scoped.
Sorting: Rows are ordered oldest to newest automatically before loading.