edge non existing stoploss fixed. solves #1370

This commit is contained in:
misagh
2018-11-29 18:31:08 +01:00
parent ff8987f517
commit 3d37c5d767
2 changed files with 18 additions and 1 deletions

View File

@@ -157,7 +157,13 @@ class Edge():
return position_size
def stoploss(self, pair: str) -> float:
return self._cached_pairs[pair].stoploss
if pair in self._cached_pairs:
return self._cached_pairs[pair].stoploss
else:
logger.warning('tried to access stoploss of a non-existing pair, '
'strategy stoploss is returned instead.')
return self.strategy.stoploss
def adjust(self, pairs) -> list:
"""