add order_time_in_force in _ft_has and revert binance

This commit is contained in:
iuvbio 2019-03-26 00:49:39 +01:00
parent 8dea640e9a
commit e15f2ef11a
2 changed files with 5 additions and 8 deletions

View File

@ -11,6 +11,7 @@ class Binance(Exchange):
_ft_has: Dict = {
"stoploss_on_exchange": True,
"order_time_in_force": ['gtc', 'fok', 'ioc'],
}
def get_order_book(self, pair: str, limit: int = 100) -> dict:
@ -24,9 +25,3 @@ class Binance(Exchange):
limit = min(list(filter(lambda x: limit <= x, limit_range)))
return super().get_order_book(pair, limit)
def validate_order_time_in_force(self, order_time_in_force: Dict) -> None:
"""
Checks if order time in force configured in strategy/config are supported
"""
pass

View File

@ -65,8 +65,9 @@ class Exchange(object):
# Dict to specify which options each exchange implements
# TODO: this should be merged with attributes from subclasses
# To avoid having to copy/paste this to all subclasses.
_ft_has = {
_ft_has: Dict = {
"stoploss_on_exchange": False,
"order_time_in_force": ["gtc"],
}
def __init__(self, config: dict) -> None:
@ -268,7 +269,8 @@ class Exchange(object):
"""
Checks if order time in force configured in strategy/config are supported
"""
if any(v != 'gtc' for k, v in order_time_in_force.items()):
if any(v not in self._ft_has["order_time_in_force"]
for k, v in order_time_in_force.items()):
raise OperationalException(
f'Time in force policies are not supporetd for {self.name} yet.')