Adding cancel buy/sell events
This commit is contained in:
@@ -244,11 +244,21 @@ class DefaultStrategy(IStrategy):
|
||||
we are notified that a given pair was bought
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
assert False is not True
|
||||
|
||||
def did_sold(self, pair: str):
|
||||
"""
|
||||
we are notified that a given pair was sold
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
assert False is not True
|
||||
|
||||
def did_cancel_buy(self, pair: str):
|
||||
"""
|
||||
we are notified that a given pair was bought
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
|
||||
def did_cancel_sell(self, pair: str):
|
||||
"""
|
||||
we are notified that a given pair was sold
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
|
@@ -59,3 +59,17 @@ class IStrategy(ABC):
|
||||
we are notified that a given pair was sold
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def did_cancel_buy(self, pair: str):
|
||||
"""
|
||||
we are notified that a given buy for a pair was cancelled
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def did_cancel_sell(self, pair: str):
|
||||
"""
|
||||
we are notified that a given sell for a pair was cancelled
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
|
@@ -181,3 +181,17 @@ class Strategy(object):
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
return self.custom_strategy.did_sold(pair)
|
||||
|
||||
def did_cancel_buy(self, pair: str):
|
||||
"""
|
||||
we are notified that a given pair was bought
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
return self.custom_strategy.did_cancel_buy(pair)
|
||||
|
||||
def did_cancel_sell(self, pair: str):
|
||||
"""
|
||||
we are notified that a given pair was sold
|
||||
:param pair: the pair that was is concerned by the dataframe
|
||||
"""
|
||||
return self.custom_strategy.did_cancel_sell(pair)
|
||||
|
Reference in New Issue
Block a user