let Strategy hold a sorted roi map

This commit is contained in:
Janne Sinivirta
2018-02-06 16:31:50 +02:00
parent a28ffcbcf7
commit 5c02f0983d
2 changed files with 5 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import os
import sys
import logging
import importlib
from collections import OrderedDict
from pandas import DataFrame
from freqtrade.strategy.interface import IStrategy
@@ -69,7 +70,9 @@ class Strategy(object):
)
# Minimal ROI designed for the strategy
self.minimal_roi = self.custom_strategy.minimal_roi
self.minimal_roi = OrderedDict(sorted(
self.custom_strategy.minimal_roi.items(),
key=lambda tuple: float(tuple[0]))) # sort after converting to number
# Optimal stoploss designed for the strategy
self.stoploss = self.custom_strategy.stoploss