fix output if no variance, and fix docs

This commit is contained in:
Stefano Ariestasia 2023-10-03 08:27:28 +09:00
parent 12dc91719e
commit 183166b3fb
4 changed files with 45 additions and 14 deletions

View File

@ -31,9 +31,9 @@ optional arguments:
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`). Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
--timerange TIMERANGE --timerange TIMERANGE
Specify what timerange of data to use. Specify what timerange of data to use.
--data-format-ohlcv {json,jsongz,hdf5} --data-format-ohlcv {json,jsongz,hdf5,feather,parquet}
Storage format for downloaded candle (OHLCV) data. Storage format for downloaded candle (OHLCV) data.
(default: `json`). (default: `feather`).
--max-open-trades INT --max-open-trades INT
Override the value of the `max_open_trades` Override the value of the `max_open_trades`
configuration setting. configuration setting.

View File

@ -40,11 +40,41 @@ usage: freqtrade recursive-analysis [-h] [-v] [--logfile FILE] [-V] [-c PATH]
[--startup-candle STARTUP_CANDLES [STARTUP_CANDLES ...]] [--startup-candle STARTUP_CANDLES [STARTUP_CANDLES ...]]
optional arguments: optional arguments:
-p PAIR, --pairs PAIR -h, --help show this help message and exit
-i TIMEFRAME, --timeframe TIMEFRAME
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
--data-format-ohlcv {json,jsongz,hdf5,feather,parquet}
Storage format for downloaded candle (OHLCV) data.
(default: `feather`).
-p PAIR, --pairs PAIR
Limit command to this pair. Limit command to this pair.
--startup-candle STARTUP_CANDLE [STARTUP_CANDLE ...] --startup-candle STARTUP_CANDLE [STARTUP_CANDLE ...]
Provide a space-separated list of startup_candle_count to Provide a space-separated list of startup_candle_count to
be checked. Default : `199 399 499 999 1999`. be checked. Default : `199 399 499 999 1999`.
Common arguments:
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
--logfile FILE Log to the file specified. Special values are:
'syslog', 'journald'. See the documentation for more
details.
-V, --version show program's version number and exit
-c PATH, --config PATH
Specify configuration file (default:
`userdir/config.json` or `config.json` whichever
exists). Multiple --config options may be used. Can be
set to `-` to read config from stdin.
-d PATH, --datadir PATH
Path to directory with historical backtesting data.
--userdir PATH, --user-data-dir PATH
Path to userdata directory.
Strategy arguments:
-s NAME, --strategy NAME
Specify strategy class name which will be used by the
bot.
--strategy-path PATH Specify additional strategy lookup path.
--timerange TIMERANGE
Specify what timerange of data to use.
``` ```
### Why are odd-numbered default startup candles used? ### Why are odd-numbered default startup candles used?

View File

@ -64,7 +64,7 @@ class RecursiveAnalysis(BaseAnalysis):
self.dict_recursive[indicator][part.startup_candle] = f"{diff:.3f}%" self.dict_recursive[indicator][part.startup_candle] = f"{diff:.3f}%"
else: else:
logger.info("No difference found. Stop the process.") logger.info("No variance on indicator(s) found due to recursive formula.")
break break
# For lookahead bias check # For lookahead bias check
@ -100,7 +100,7 @@ class RecursiveAnalysis(BaseAnalysis):
# logger.info("part value {:.5f}".format(values_diff_other)) # logger.info("part value {:.5f}".format(values_diff_other))
else: else:
logger.info("No lookahead bias on indicators found. Stop the process.") logger.info("No lookahead bias on indicators found.")
def prepare_data(self, varholder: VarHolder, pairs_to_load: List[DataFrame]): def prepare_data(self, varholder: VarHolder, pairs_to_load: List[DataFrame]):

View File

@ -31,11 +31,14 @@ class RecursiveAnalysisSubFunctions:
temp_data.append(values.get(int(candle), '-')) temp_data.append(values.get(int(candle), '-'))
data.append(temp_data) data.append(temp_data)
if len(data) > 0:
from tabulate import tabulate from tabulate import tabulate
table = tabulate(data, headers=headers, tablefmt="orgtbl") table = tabulate(data, headers=headers, tablefmt="orgtbl")
print(table) print(table)
return table, headers, data return table, headers, data
return None
@staticmethod @staticmethod
def calculate_config_overrides(config: Config): def calculate_config_overrides(config: Config):
if 'timerange' not in config: if 'timerange' not in config:
@ -81,8 +84,7 @@ class RecursiveAnalysisSubFunctions:
if not (strategy_list := config.get('strategy_list', [])): if not (strategy_list := config.get('strategy_list', [])):
if config.get('strategy') is None: if config.get('strategy') is None:
raise OperationalException( raise OperationalException(
"No Strategy specified. Please specify a strategy via --strategy or " "No Strategy specified. Please specify a strategy via --strategy"
"--strategy-list"
) )
strategy_list = [config['strategy']] strategy_list = [config['strategy']]
@ -101,6 +103,5 @@ class RecursiveAnalysisSubFunctions:
RecursiveAnalysis_instances) RecursiveAnalysis_instances)
else: else:
logger.error("There were no strategies specified neither through " logger.error("There were no strategies specified neither through "
"--strategy nor through " "--strategy "
"--strategy-list "
"or timeframe was not specified.") "or timeframe was not specified.")