commit
b9237d2241
@ -134,7 +134,7 @@ class DataProvider:
|
|||||||
combination.
|
combination.
|
||||||
Returns empty dataframe and Epoch 0 (1970-01-01) if no dataframe was cached.
|
Returns empty dataframe and Epoch 0 (1970-01-01) if no dataframe was cached.
|
||||||
"""
|
"""
|
||||||
pair_key = (pair, timeframe, CandleType.SPOT)
|
pair_key = (pair, timeframe, self._config.get('candle_type_def', CandleType.SPOT))
|
||||||
if pair_key in self.__cached_pairs:
|
if pair_key in self.__cached_pairs:
|
||||||
if self.runmode in (RunMode.DRY_RUN, RunMode.LIVE):
|
if self.runmode in (RunMode.DRY_RUN, RunMode.LIVE):
|
||||||
df, date = self.__cached_pairs[pair_key]
|
df, date = self.__cached_pairs[pair_key]
|
||||||
|
@ -1865,6 +1865,7 @@ class Exchange:
|
|||||||
mark_rates = candle_histories[mark_comb]
|
mark_rates = candle_histories[mark_comb]
|
||||||
|
|
||||||
df = funding_rates.merge(mark_rates, on='date', how="inner", suffixes=["_fund", "_mark"])
|
df = funding_rates.merge(mark_rates, on='date', how="inner", suffixes=["_fund", "_mark"])
|
||||||
|
if not df.empty:
|
||||||
df = df[(df['date'] >= open_date) & (df['date'] <= close_date)]
|
df = df[(df['date'] >= open_date) & (df['date'] <= close_date)]
|
||||||
fees = sum(df['open_fund'] * df['open_mark'] * amount)
|
fees = sum(df['open_fund'] * df['open_mark'] * amount)
|
||||||
|
|
||||||
|
@ -139,4 +139,10 @@ class PairListManager():
|
|||||||
"""
|
"""
|
||||||
Create list of pair tuples with (pair, timeframe)
|
Create list of pair tuples with (pair, timeframe)
|
||||||
"""
|
"""
|
||||||
return [(pair, timeframe or self._config['timeframe'], CandleType.SPOT) for pair in pairs]
|
return [
|
||||||
|
(
|
||||||
|
pair,
|
||||||
|
timeframe or self._config['timeframe'],
|
||||||
|
self._config.get('candle_type_def', CandleType.SPOT)
|
||||||
|
) for pair in pairs
|
||||||
|
]
|
||||||
|
@ -564,7 +564,9 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||||||
"""
|
"""
|
||||||
if not self.dp:
|
if not self.dp:
|
||||||
raise OperationalException("DataProvider not found.")
|
raise OperationalException("DataProvider not found.")
|
||||||
dataframe = self.dp.ohlcv(pair, self.timeframe)
|
dataframe = self.dp.ohlcv(
|
||||||
|
pair, self.timeframe, candle_type=self.config.get('candle_type_def', CandleType.SPOT)
|
||||||
|
)
|
||||||
if not isinstance(dataframe, DataFrame) or dataframe.empty:
|
if not isinstance(dataframe, DataFrame) or dataframe.empty:
|
||||||
logger.warning('Empty candle (OHLCV) data for pair %s', pair)
|
logger.warning('Empty candle (OHLCV) data for pair %s', pair)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user