add order_time_in_force in _ft_has and revert binance
This commit is contained in:
parent
8dea640e9a
commit
e15f2ef11a
@ -11,6 +11,7 @@ class Binance(Exchange):
|
|||||||
|
|
||||||
_ft_has: Dict = {
|
_ft_has: Dict = {
|
||||||
"stoploss_on_exchange": True,
|
"stoploss_on_exchange": True,
|
||||||
|
"order_time_in_force": ['gtc', 'fok', 'ioc'],
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_order_book(self, pair: str, limit: int = 100) -> dict:
|
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)))
|
limit = min(list(filter(lambda x: limit <= x, limit_range)))
|
||||||
|
|
||||||
return super().get_order_book(pair, limit)
|
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
|
|
||||||
|
@ -65,8 +65,9 @@ class Exchange(object):
|
|||||||
# Dict to specify which options each exchange implements
|
# Dict to specify which options each exchange implements
|
||||||
# TODO: this should be merged with attributes from subclasses
|
# TODO: this should be merged with attributes from subclasses
|
||||||
# To avoid having to copy/paste this to all subclasses.
|
# To avoid having to copy/paste this to all subclasses.
|
||||||
_ft_has = {
|
_ft_has: Dict = {
|
||||||
"stoploss_on_exchange": False,
|
"stoploss_on_exchange": False,
|
||||||
|
"order_time_in_force": ["gtc"],
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, config: dict) -> None:
|
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
|
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(
|
raise OperationalException(
|
||||||
f'Time in force policies are not supporetd for {self.name} yet.')
|
f'Time in force policies are not supporetd for {self.name} yet.')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user