Module areix_io.datafeed
Classes
class CryptoDataFeed (symbols, start_date=None, end_date=None, period='1y', interval='1d', order_ascending=True, store_path=None)
-
DataFeed base class
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
- areix_io.datafeed.DataFeed
- abc.ABC
class CsvDataFeed (paths, start_date=None, end_date=None, period=None, order_ascending=True)
-
DataFeed base class
CsvDataFeed will read all the files on your specified path
Requirement
- csv format
- tradedate as index
- columns consist of 'open','high','low','close',('adj_close','lot_size','volume','dividends')
Args
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. Defaults to None.
order_ascending
:bool
, optional- If True, data would be in ascending order. Defaults to True.
Ancestors
- areix_io.datafeed.DataFeed
- abc.ABC
class StockDataFeed (symbols, start_date=None, end_date=None, period='1y', interval='1d', order_ascending=True, store_path=None, use_adjust=True, back_adjust=False, prepost=False, actions=True, proxy=None, rounding=False, tz=None)
-
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', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'
- Defaults to '1d'.
store_path
:[str]
, optional- The path to store downloaded data files. Defaults to None.
use_adjust
:[bool]
, optional- If True, adjust prices relative to adj_close for dividends and splits. Defaults to True.
back_adjust
:[bool]
, optional- Backward adjust data. Defaults to False.
prepost
:[bool]
, optional- If True, the premaket and postmarket data will be downloaded as well. Defaults to False.
actions
:[bool]
, optional- If True, the
lot_size
,dividends
,splits
will be downloaded as well. Defaults to True. proxy
:[str]
, optional- The proxy use for download data, prevent the ip being banned. Defaults to None.
rounding
:[bool]
, optional- Rounding. Defaults to False.
tz
:[pytz]
, optional- Timezone. Defaults to None.
Returns
[dict]
- The dict of instrument bar data
Ancestors
- areix_io.datafeed.DataFeed
- abc.ABC