stop loss range added to args
This commit is contained in:
parent
36030176bb
commit
b0e4aa8eff
@ -199,6 +199,13 @@ class Arguments(object):
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
dest='refresh_pairs',
|
dest='refresh_pairs',
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--stoplosses',
|
||||||
|
help='defines a range of stoploss against which edge will assess the strategy'
|
||||||
|
'the format is "min, max, step". example: -0.01, -0.1, -0.001',
|
||||||
|
type=str,
|
||||||
|
dest='stoploss_range',
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--export',
|
'--export',
|
||||||
help='export backtest results, argument are: trades\
|
help='export backtest results, argument are: trades\
|
||||||
|
@ -227,6 +227,14 @@ class Configuration(object):
|
|||||||
config.update({'timerange': self.args.timerange})
|
config.update({'timerange': self.args.timerange})
|
||||||
logger.info('Parameter --timerange detected: %s ...', self.args.timerange)
|
logger.info('Parameter --timerange detected: %s ...', self.args.timerange)
|
||||||
|
|
||||||
|
# If --timerange is used we add it to the configuration
|
||||||
|
if 'stoploss_range' in self.args and self.args.stoploss_range:
|
||||||
|
txt_range = eval(self.args.stoploss_range)
|
||||||
|
config['edge'].update({'stoploss_range_min': txt_range[0]})
|
||||||
|
config['edge'].update({'stoploss_range_max': txt_range[1]})
|
||||||
|
config['edge'].update({'stoploss_range_step': txt_range[2]})
|
||||||
|
logger.info('Parameter --stoplosses detected: %s ...', self.args.stoploss_range)
|
||||||
|
|
||||||
# If --datadir is used we add it to the configuration
|
# If --datadir is used we add it to the configuration
|
||||||
if 'datadir' in self.args and self.args.datadir:
|
if 'datadir' in self.args and self.args.datadir:
|
||||||
config.update({'datadir': self.args.datadir})
|
config.update({'datadir': self.args.datadir})
|
||||||
|
@ -53,7 +53,7 @@ class EdgeCli(object):
|
|||||||
|
|
||||||
def _generate_edge_table(self, results: dict) -> str:
|
def _generate_edge_table(self, results: dict) -> str:
|
||||||
|
|
||||||
floatfmt = ('s', '.2f', '.2f', '.2f', '.2f', '.2f', 'd', '.d')
|
floatfmt = ('s', '.10g', '.2f', '.2f', '.2f', '.2f', 'd', '.d')
|
||||||
tabular_data = []
|
tabular_data = []
|
||||||
headers = ['pair', 'stoploss', 'win rate', 'risk reward ratio',
|
headers = ['pair', 'stoploss', 'win rate', 'risk reward ratio',
|
||||||
'required risk reward', 'expectancy', 'total number of trades', 'average duration (min)']
|
'required risk reward', 'expectancy', 'total number of trades', 'average duration (min)']
|
||||||
|
Loading…
Reference in New Issue
Block a user