mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-13 03:33:55 +00:00
Add lock_pairs to interface
This commit is contained in:
parent
1ce63b5b42
commit
c042d08bb7
|
@ -107,6 +107,7 @@ class IStrategy(ABC):
|
||||||
self.config = config
|
self.config = config
|
||||||
# Dict to determine if analysis is necessary
|
# Dict to determine if analysis is necessary
|
||||||
self._last_candle_seen_per_pair: Dict[str, datetime] = {}
|
self._last_candle_seen_per_pair: Dict[str, datetime] = {}
|
||||||
|
self._pair_locked_until: Dict[str, datetime] = {}
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
|
@ -154,6 +155,13 @@ class IStrategy(ABC):
|
||||||
"""
|
"""
|
||||||
return self.__class__.__name__
|
return self.__class__.__name__
|
||||||
|
|
||||||
|
def lock_pair(self, pair: str, until: datetime) -> None:
|
||||||
|
"""
|
||||||
|
Locks pair until a given timestamp happens.
|
||||||
|
Locked pairs are not analyzed, and are prevented from opening new trades.
|
||||||
|
"""
|
||||||
|
self._pair_locked_until['pair'] = until
|
||||||
|
|
||||||
def analyze_ticker(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
def analyze_ticker(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
"""
|
"""
|
||||||
Parses the given ticker history and returns a populated DataFrame
|
Parses the given ticker history and returns a populated DataFrame
|
||||||
|
|
Loading…
Reference in New Issue
Block a user