make Strategy store roi and stoploss values as numbers to avoid later casting

This commit is contained in:
Janne Sinivirta
2018-02-11 15:02:42 +02:00
parent 5190cd507e
commit 2ce03ab1b5
5 changed files with 15 additions and 16 deletions

View File

@@ -71,11 +71,11 @@ class Strategy(object):
# Minimal ROI designed for the strategy
self.minimal_roi = OrderedDict(sorted(
self.custom_strategy.minimal_roi.items(),
key=lambda tuple: float(tuple[0]))) # sort after converting to number
{int(key): value for (key, value) in self.custom_strategy.minimal_roi.items()}.items(),
key=lambda tuple: tuple[0])) # sort after converting to number
# Optimal stoploss designed for the strategy
self.stoploss = self.custom_strategy.stoploss
self.stoploss = float(self.custom_strategy.stoploss)
self.ticker_interval = self.custom_strategy.ticker_interval