tests and flake8 compliance

This commit is contained in:
Nullart
2018-06-18 18:05:43 +08:00
parent 735356197d
commit 2f6673fbe7
5 changed files with 48 additions and 27 deletions

View File

@@ -247,7 +247,7 @@ class Analyze(object):
return {pair: self.populate_indicators(self.parse_ticker_dataframe(pair_data))
for pair, pair_data in tickerdata.items()}
def trunc_num(self,f, n):
def trunc_num(self, f, n):
import math
return math.floor(f * 10 ** n) / 10 ** n
@@ -257,5 +257,4 @@ class Analyze(object):
for duration, threshold in self.strategy.minimal_roi.items():
if time_diff > duration:
roi_rate = (trade.open_rate * (1 + threshold)) * (1+(2.1*get_fee(trade.pair)))
return self.trunc_num(roi_rate,8)
return self.trunc_num(roi_rate, 8)