Use string typehints to avoid import errors

This commit is contained in:
Matthias 2020-03-01 09:43:20 +01:00
parent cd54875f03
commit 4d8430c687
3 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,7 @@ class Awesomestrategy(IStrategy):
'sell': 60 * 25
}
def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:
def check_buy_timeout(self, pair: str, trade: 'Trade', order: dict, **kwargs) -> bool:
if trade.open_rate > 100 and trade.open_date < datetime.utcnow() - timedelta(minutes=5):
return True
elif trade.open_rate > 10 and trade.open_date < datetime.utcnow() - timedelta(minutes=3):
@ -43,7 +43,7 @@ class Awesomestrategy(IStrategy):
return False
def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:
def check_sell_timeout(self, pair: str, trade: 'Trade', order: dict, **kwargs) -> bool:
if trade.open_rate > 100 and trade.open_date < datetime.utcnow() - timedelta(minutes=5):
return True
elif trade.open_rate > 10 and trade.open_date < datetime.utcnow() - timedelta(minutes=3):

View File

@ -149,7 +149,7 @@ class IStrategy(ABC):
:return: DataFrame with sell column
"""
def check_buy_timeout(self, pair: str, trade: Trade, order: Dict, **kwargs) -> bool:
def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:
"""
Check buy timeout function callback.
This method can be used to override the buy-timeout.
@ -167,7 +167,7 @@ class IStrategy(ABC):
"""
return False
def check_sell_timeout(self, pair: str, trade: Trade, order: Dict, **kwargs) -> bool:
def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:
"""
Check sell timeout function callback.
This method can be used to override the sell-timeout.

View File

@ -1,5 +1,5 @@
def check_buy_timeout(self, pair: str, trade: 'Trade', order: Dict, **kwargs) -> bool:
def check_buy_timeout(self, pair: str, trade: 'Trade', order: dict, **kwargs) -> bool:
"""
Check buy timeout function callback.
This method can be used to override the buy-timeout.
@ -19,7 +19,7 @@ def check_buy_timeout(self, pair: str, trade: 'Trade', order: Dict, **kwargs) ->
"""
return False
def check_sell_timeout(self, pair: str, trade: 'Trade', order: Dict, **kwargs) -> bool:
def check_sell_timeout(self, pair: str, trade: 'Trade', order: dict, **kwargs) -> bool:
"""
Check sell timeout function callback.
This method can be used to override the sell-timeout.