Merge pull request #1788 from hroff-1902/hyperopt-print-all
--print-all command line option for hyperopt
This commit is contained in:
commit
86ec88b8fe
@ -283,7 +283,6 @@ class Arguments(object):
|
||||
dest='position_stacking',
|
||||
default=False
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--dmmp', '--disable-max-market-positions',
|
||||
help='Disable applying `max_open_trades` during backtest '
|
||||
@ -309,6 +308,13 @@ class Arguments(object):
|
||||
nargs='+',
|
||||
dest='spaces',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--print-all',
|
||||
help='Print all results, not only the best ones.',
|
||||
action='store_true',
|
||||
dest='print_all',
|
||||
default=False
|
||||
)
|
||||
|
||||
def _build_subcommands(self) -> None:
|
||||
"""
|
||||
|
@ -320,6 +320,10 @@ class Configuration(object):
|
||||
config.update({'spaces': self.args.spaces})
|
||||
logger.info('Parameter -s/--spaces detected: %s', config.get('spaces'))
|
||||
|
||||
if 'print_all' in self.args and self.args.print_all:
|
||||
config.update({'print_all': self.args.print_all})
|
||||
logger.info('Parameter --print-all detected: %s', config.get('print_all'))
|
||||
|
||||
return config
|
||||
|
||||
def _validate_config_schema(self, conf: Dict[str, Any]) -> Dict[str, Any]:
|
||||
|
@ -115,7 +115,7 @@ class Hyperopt(Backtesting):
|
||||
"""
|
||||
Log results if it is better than any previous evaluation
|
||||
"""
|
||||
if results['loss'] < self.current_best_loss:
|
||||
if self.config.get('print_all', False) or results['loss'] < self.current_best_loss:
|
||||
current = results['current_tries']
|
||||
total = results['total_tries']
|
||||
res = results['result']
|
||||
|
Loading…
Reference in New Issue
Block a user