add typehints and type: ignores

This commit is contained in:
xmatthias
2018-05-31 22:00:46 +02:00
parent cf34b84cf1
commit 3fb1dd02f1
4 changed files with 9 additions and 9 deletions

View File

@@ -95,7 +95,7 @@ class Analyze(object):
Return ticker interval to use
:return: Ticker interval value to use
"""
return self.strategy.ticker_interval
return self.strategy.ticker_interval # type: ignore
def analyze_ticker(self, ticker_history: List[Dict]) -> DataFrame:
"""
@@ -195,13 +195,13 @@ class Analyze(object):
:return True if bot should sell at current rate
"""
current_profit = trade.calc_profit_percent(current_rate)
if self.strategy.stoploss is not None and current_profit < self.strategy.stoploss:
if self.strategy.stoploss is not None and current_profit < self.strategy.stoploss: # type: ignore
logger.debug('Stop loss hit.')
return True
# Check if time matches and current rate is above threshold
time_diff = (current_time.timestamp() - trade.open_date.timestamp()) / 60
for duration, threshold in self.strategy.minimal_roi.items():
for duration, threshold in self.strategy.minimal_roi.items(): # type: ignore
if time_diff <= duration:
return False
if current_profit > threshold: