declaring local variables. using get for configuration

This commit is contained in:
misagh 2018-10-01 17:21:40 +02:00
parent aa1948750f
commit 114fd7feef

View File

@ -23,7 +23,12 @@ logger = logging.getLogger(__name__)
class Edge(): class Edge():
config: Dict = {} config: Dict = {}
_cached_pairs: list = [] _last_updated: int # Timestamp of pairs last updated time
_cached_pairs: list = [] # Keeps an array of
# [pair, winrate, risk reward ratio, required risk reward, expectancy]
_total_capital: float
_allowed_risk: float
def __init__(self, config: Dict[str, Any], exchange=None) -> None: def __init__(self, config: Dict[str, Any], exchange=None) -> None:
self.config = config self.config = config
@ -35,11 +40,10 @@ class Edge():
self.advise_buy = self.strategy.advise_buy self.advise_buy = self.strategy.advise_buy
self.edge_config = self.config.get('edge', {}) self.edge_config = self.config.get('edge', {})
self._last_updated = None self._last_updated = None
self._cached_pairs: list = [] self._cached_pairs: list = []
self._total_capital = self.edge_config['total_capital_in_stake_currency'] self._total_capital = self.edge_config.get('total_capital_in_stake_currency')
self._allowed_risk = self.edge_config['allowed_risk'] self._allowed_risk = self.edge_config.get('allowed_risk')
### ###
# #