Fix flake issues

This commit is contained in:
froggleston 2022-05-17 22:32:17 +01:00
parent bb758da940
commit 37e4ede65c
3 changed files with 15 additions and 13 deletions

View File

@ -105,7 +105,8 @@ Possible values are any floats between 0.0 and 0.99
For futures data, exchanges commonly provide the futures candles, the marks, and the funding rates. However, it is common that whilst candles and marks might be available, the funding rates are not. This can affect backtesting timeranges, i.e. you may only be able to test recent timeranges and not earlier, experiencing the `No data found. Terminating.` error. To get around this, add the `futures_funding_rate` config option as listed in [configuration.md](configuration.md), and it is recommended that you set this to `0`, unless you know a given specific funding rate for your pair, exchange and timerange. Setting this to anything other than `0` can have drastic effects on your profit calculations within strategy, e.g. within the `custom_exit`, `custom_stoploss`, etc functions.
!!! This will not overwrite funding rates that are available from the exchange.
!!! Warning This will mean your backtests are inaccurate.
This will not overwrite funding rates that are available from the exchange, but bear in mind that setting a false funding rate will mean backtesting results will be inaccurate for historical timeranges where funding rates are not available.
### Developer

View File

@ -69,7 +69,7 @@ def load_data(datadir: Path,
fail_without_data: bool = False,
data_format: str = 'json',
candle_type: CandleType = CandleType.SPOT,
user_futures_funding_rate = None,
user_futures_funding_rate: int = None,
) -> Dict[str, DataFrame]:
"""
Load ohlcv history data for a list of pairs.

View File

@ -295,7 +295,8 @@ class Backtesting:
self.futures_data[pair] = mark_rates_dict[pair]
else:
self.futures_data[pair] = mark_rates_dict[pair].merge(
funding_rates_dict[pair], on='date', how="inner", suffixes=["_fund", "_mark"])
funding_rates_dict[pair], on='date',
how="inner", suffixes=["_fund", "_mark"])
if unavailable_pairs:
raise OperationalException(