edge tests fixed for position sizing

This commit is contained in:
misagh
2018-11-27 14:02:34 +01:00
parent f5a70750f0
commit 159ac6e657
5 changed files with 20 additions and 18 deletions

View File

@@ -162,8 +162,8 @@ class Edge():
def stake_amount(self, pair: str, capital: float) -> float:
stoploss = self._cached_pairs[pair].stoploss
available_capital = capital * self._capital_percentage
allowed_capital_at_risk = round(available_capital * self._allowed_risk, 5)
position_size = abs(round((allowed_capital_at_risk / stoploss), 5))
allowed_capital_at_risk = round(available_capital * self._allowed_risk, 15)
position_size = abs(round((allowed_capital_at_risk / stoploss), 15))
return position_size
def stoploss(self, pair: str) -> float:
@@ -207,7 +207,7 @@ class Edge():
# 0.05% is 0.0005
# fee = 0.001
stake = self.config.get('stake_amount')
stake = 0.015
fee = self.fee
open_fee = fee / 2