Module areixio.datafeeds.stock_datafeed
Classes
class StockDataFeed (code: str, asset_type: Union[str, AssetType, ForwardRef(None)] = AssetType.STOCK, start_date: Union[str, datetime.datetime, ForwardRef(None)] = None, end_date: Union[str, datetime.datetime, ForwardRef(None)] = None, period: Optional[str] = '', interval: Optional[str] = '1d', min_volume: Union[int, float, ForwardRef(None)] = 1, min_notional: Union[int, float, ForwardRef(None)] = 1, order_ascending: Optional[bool] = True, store_path: Optional[str] = None, debug: Optional[bool] = False, **kwargs)
-
DataFeed base class
StockDataFeed
Args
symbols
:[list]
- list of symbols
paths
:[list,str]
- list of paths or path that contains the data files
start_date
:[datetime, str]
, optional- The start date (if it is str, the format need to be '%Y-%m-%d'). Defaults to None.
end_date
:[datetime, str]
, optional- The end date (if it is str, the format need to be '%Y-%m-%d'). Defaults to None.
- period ([str], optional):
- - The period of data you need
- - If
start_date
andend_date
are specified, theperiod
wont be effective - - The
period
as to be one of the following, '1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd' - - Defaults to '1y'.
order_ascending
:bool
, optional- If True, data would be in ascending order. Defaults to True.
- interval ([str], optional):
- - The data datetime interval
- - The interval has to be one of the following, '1m', '5m','15m', '30m','1h', '2h', '3h', '4h', '6h', '12h', '1d', '1M', '1y'
- - Defaults to '1d'.
store_path
:[str]
, optional- The path to store downloaded data files. Defaults to None.
Ancestors
- areixio.datafeed.DataFeed
- abc.ABC
Methods
def fetch_hist(self, start: Union[datetime.datetime, str], end: Union[datetime.datetime, str], interval: str = None, code: str = None)
def fetch_info(self, code: str = None)
def fetch_spot(self, code: str = None, interval: str = None)