added minimum win rate to config

This commit is contained in:
misagh
2018-11-03 14:31:34 +01:00
parent f6498bf5f7
commit b6d4e11e88
4 changed files with 23 additions and 16 deletions

View File

@@ -182,7 +182,7 @@ CONF_SCHEMA = {
"stoploss_range_min": {'type': 'number'},
"stoploss_range_max": {'type': 'number'},
"stoploss_range_step": {'type': 'number'},
"maximum_winrate": {'type': 'number'},
"minimum_winrate": {'type': 'number'},
"minimum_expectancy": {'type': 'number'},
"min_trade_number": {'type': 'number'},
"max_trade_duration_minute": {'type': 'integer'},

View File

@@ -145,10 +145,18 @@ class Edge():
def filter(self, pairs) -> list:
# Filtering pairs acccording to the expectancy
filtered_expectancy: list = []
# [pair, stoploss, winrate, risk reward ratio, required risk reward, expectancy]
filtered_expectancy = [
x[0] for x in self._cached_pairs if x[5] > float(
self.edge_config.get(
'minimum_expectancy', 0.2))]
x[0] for x in self._cached_pairs if (
(x[5] > float(
self.edge_config.get(
'minimum_expectancy',
0.2))) & (
x[2] > float(
self.edge_config.get(
'minimum_winrate',
0.60))))]
# Only return pairs which are included in "pairs" argument list
final = [x for x in filtered_expectancy if x in pairs]