Added candle_type in doc strings
This commit is contained in:
@@ -55,6 +55,7 @@ class DataProvider:
|
||||
:param pair: pair to get the data for
|
||||
:param timeframe: Timeframe to get data for
|
||||
:param dataframe: analyzed dataframe
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
"""
|
||||
self.__cached_pairs[(pair, timeframe, candle_type)] = (
|
||||
dataframe, datetime.now(timezone.utc))
|
||||
@@ -75,6 +76,7 @@ class DataProvider:
|
||||
Get stored historical candle (OHLCV) data
|
||||
:param pair: pair to get the data for
|
||||
:param timeframe: timeframe to get data for
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
"""
|
||||
saved_pair = (pair, str(timeframe), candle_type)
|
||||
if saved_pair not in self.__cached_pairs_backtesting:
|
||||
@@ -106,6 +108,7 @@ class DataProvider:
|
||||
:param pair: pair to get the data for
|
||||
:param timeframe: timeframe to get data for
|
||||
:return: Dataframe for this pair
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
"""
|
||||
if self.runmode in (RunMode.DRY_RUN, RunMode.LIVE):
|
||||
# Get live OHLCV data.
|
||||
@@ -128,6 +131,7 @@ class DataProvider:
|
||||
and the last 1000 candles (up to the time evaluated at this moment) in all other modes.
|
||||
:param pair: pair to get the data for
|
||||
:param timeframe: timeframe to get data for
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: Tuple of (Analyzed Dataframe, lastrefreshed) for the requested pair / timeframe
|
||||
combination.
|
||||
Returns empty dataframe and Epoch 0 (1970-01-01) if no dataframe was cached.
|
||||
@@ -212,6 +216,7 @@ class DataProvider:
|
||||
Please use the `available_pairs` method to verify which pairs are currently cached.
|
||||
:param pair: pair to get the data for
|
||||
:param timeframe: Timeframe to get data for
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:param copy: copy dataframe before returning if True.
|
||||
Use False only for read-only operations (where the dataframe is not modified)
|
||||
"""
|
||||
|
@@ -49,6 +49,7 @@ class HDF5DataHandler(IDataHandler):
|
||||
for the specified timeframe
|
||||
:param datadir: Directory to search for ohlcv files
|
||||
:param timeframe: Timeframe to search pairs for
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: List of Pairs
|
||||
"""
|
||||
|
||||
@@ -74,6 +75,7 @@ class HDF5DataHandler(IDataHandler):
|
||||
:param pair: Pair - used to generate filename
|
||||
:param timeframe: Timeframe - used to generate filename
|
||||
:param data: Dataframe containing OHLCV data
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: None
|
||||
"""
|
||||
key = self._pair_ohlcv_key(pair, timeframe)
|
||||
@@ -98,6 +100,7 @@ class HDF5DataHandler(IDataHandler):
|
||||
:param timerange: Limit data to be loaded to this timerange.
|
||||
Optionally implemented by subclasses to avoid loading
|
||||
all data where possible.
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: DataFrame with ohlcv data, or empty DataFrame
|
||||
"""
|
||||
key = self._pair_ohlcv_key(pair, timeframe)
|
||||
@@ -130,6 +133,7 @@ class HDF5DataHandler(IDataHandler):
|
||||
Remove data for this pair
|
||||
:param pair: Delete data for this pair.
|
||||
:param timeframe: Timeframe (e.g. "5m")
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: True when deleted, false if file did not exist.
|
||||
"""
|
||||
filename = self._pair_data_filename(self._datadir, pair, timeframe, candle_type)
|
||||
@@ -150,6 +154,7 @@ class HDF5DataHandler(IDataHandler):
|
||||
:param pair: Pair
|
||||
:param timeframe: Timeframe this ohlcv data is for
|
||||
:param data: Data to append.
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
@@ -44,6 +44,7 @@ def load_pair_history(pair: str,
|
||||
:param startup_candles: Additional candles to load at the start of the period
|
||||
:param data_handler: Initialized data-handler to use.
|
||||
Will be initialized from data_format if not set
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: DataFrame with ohlcv data, or empty DataFrame
|
||||
"""
|
||||
data_handler = get_datahandler(datadir, data_format, data_handler)
|
||||
@@ -79,6 +80,7 @@ def load_data(datadir: Path,
|
||||
:param startup_candles: Additional candles to load at the start of the period
|
||||
:param fail_without_data: Raise OperationalException if no data is found.
|
||||
:param data_format: Data format which should be used. Defaults to json
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: dict(<pair>:<Dataframe>)
|
||||
"""
|
||||
result: Dict[str, DataFrame] = {}
|
||||
@@ -120,6 +122,7 @@ def refresh_data(datadir: Path,
|
||||
:param exchange: Exchange object
|
||||
:param data_format: dataformat to use
|
||||
:param timerange: Limit data to be loaded to this timerange
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
"""
|
||||
data_handler = get_datahandler(datadir, data_format)
|
||||
for idx, pair in enumerate(pairs):
|
||||
@@ -186,6 +189,7 @@ def _download_pair_history(pair: str, *,
|
||||
:param pair: pair to download
|
||||
:param timeframe: Timeframe (e.g "5m")
|
||||
:param timerange: range of time to download
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: bool with success state
|
||||
"""
|
||||
data_handler = get_datahandler(datadir, data_handler=data_handler)
|
||||
|
@@ -46,6 +46,7 @@ class IDataHandler(ABC):
|
||||
for the specified timeframe
|
||||
:param datadir: Directory to search for ohlcv files
|
||||
:param timeframe: Timeframe to search pairs for
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: List of Pairs
|
||||
"""
|
||||
|
||||
@@ -62,6 +63,7 @@ class IDataHandler(ABC):
|
||||
:param pair: Pair - used to generate filename
|
||||
:param timeframe: Timeframe - used to generate filename
|
||||
:param data: Dataframe containing OHLCV data
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: None
|
||||
"""
|
||||
|
||||
@@ -79,6 +81,7 @@ class IDataHandler(ABC):
|
||||
:param timerange: Limit data to be loaded to this timerange.
|
||||
Optionally implemented by subclasses to avoid loading
|
||||
all data where possible.
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: DataFrame with ohlcv data, or empty DataFrame
|
||||
"""
|
||||
|
||||
@@ -88,6 +91,7 @@ class IDataHandler(ABC):
|
||||
Remove data for this pair
|
||||
:param pair: Delete data for this pair.
|
||||
:param timeframe: Timeframe (e.g. "5m")
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: True when deleted, false if file did not exist.
|
||||
"""
|
||||
|
||||
@@ -104,6 +108,7 @@ class IDataHandler(ABC):
|
||||
:param pair: Pair
|
||||
:param timeframe: Timeframe this ohlcv data is for
|
||||
:param data: Data to append.
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
"""
|
||||
|
||||
@abstractclassmethod
|
||||
@@ -177,6 +182,7 @@ class IDataHandler(ABC):
|
||||
:param drop_incomplete: Drop last candle assuming it may be incomplete.
|
||||
:param startup_candles: Additional candles to load at the start of the period
|
||||
:param warn_no_data: Log a warning message when no data is found
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: DataFrame with ohlcv data, or empty DataFrame
|
||||
"""
|
||||
# Fix startup period
|
||||
|
@@ -49,6 +49,7 @@ class JsonDataHandler(IDataHandler):
|
||||
for the specified timeframe
|
||||
:param datadir: Directory to search for ohlcv files
|
||||
:param timeframe: Timeframe to search pairs for
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: List of Pairs
|
||||
"""
|
||||
if candle_type:
|
||||
@@ -75,6 +76,7 @@ class JsonDataHandler(IDataHandler):
|
||||
:param pair: Pair - used to generate filename
|
||||
:param timeframe: Timeframe - used to generate filename
|
||||
:param data: Dataframe containing OHLCV data
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: None
|
||||
"""
|
||||
filename = self._pair_data_filename(
|
||||
@@ -105,6 +107,7 @@ class JsonDataHandler(IDataHandler):
|
||||
:param timerange: Limit data to be loaded to this timerange.
|
||||
Optionally implemented by subclasses to avoid loading
|
||||
all data where possible.
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: DataFrame with ohlcv data, or empty DataFrame
|
||||
"""
|
||||
filename = self._pair_data_filename(self._datadir, pair, timeframe, candle_type=candle_type)
|
||||
@@ -129,6 +132,7 @@ class JsonDataHandler(IDataHandler):
|
||||
Remove data for this pair
|
||||
:param pair: Delete data for this pair.
|
||||
:param timeframe: Timeframe (e.g. "5m")
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
:return: True when deleted, false if file did not exist.
|
||||
"""
|
||||
filename = self._pair_data_filename(self._datadir, pair, timeframe, candle_type=candle_type)
|
||||
@@ -149,6 +153,7 @@ class JsonDataHandler(IDataHandler):
|
||||
:param pair: Pair
|
||||
:param timeframe: Timeframe this ohlcv data is for
|
||||
:param data: Data to append.
|
||||
:param candle_type: '', mark, index, premiumIndex, or funding_rate
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
Reference in New Issue
Block a user