2022-03-12 10:15:27 +00:00
|
|
|
"""
|
|
|
|
The strategies here are minimal strategies designed to fail loading in certain conditions.
|
|
|
|
They are not operational, and don't aim to be.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from datetime import datetime
|
2022-03-12 09:05:16 +00:00
|
|
|
|
|
|
|
from pandas import DataFrame
|
|
|
|
|
2023-03-02 05:23:01 +00:00
|
|
|
from freqtrade.persistence.trade_model import Order
|
2022-03-12 09:05:16 +00:00
|
|
|
from freqtrade.strategy.interface import IStrategy
|
|
|
|
|
|
|
|
|
|
|
|
class TestStrategyNoImplements(IStrategy):
|
|
|
|
|
|
|
|
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
|
|
|
return super().populate_indicators(dataframe, metadata)
|
|
|
|
|
|
|
|
|
|
|
|
class TestStrategyNoImplementSell(TestStrategyNoImplements):
|
|
|
|
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
|
|
|
return super().populate_entry_trend(dataframe, metadata)
|
2022-03-12 10:15:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestStrategyImplementCustomSell(TestStrategyNoImplementSell):
|
|
|
|
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
|
|
|
return super().populate_exit_trend(dataframe, metadata)
|
|
|
|
|
|
|
|
def custom_sell(self, pair: str, trade, current_time: datetime,
|
|
|
|
current_rate: float, current_profit: float,
|
|
|
|
**kwargs):
|
|
|
|
return False
|
2022-03-25 18:46:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestStrategyImplementBuyTimeout(TestStrategyNoImplementSell):
|
|
|
|
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
|
|
|
return super().populate_exit_trend(dataframe, metadata)
|
|
|
|
|
2023-03-02 05:23:01 +00:00
|
|
|
def check_buy_timeout(self, pair: str, trade, order: Order,
|
2022-03-25 18:46:56 +00:00
|
|
|
current_time: datetime, **kwargs) -> bool:
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
class TestStrategyImplementSellTimeout(TestStrategyNoImplementSell):
|
|
|
|
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
|
|
|
return super().populate_exit_trend(dataframe, metadata)
|
|
|
|
|
2023-03-02 05:23:01 +00:00
|
|
|
def check_sell_timeout(self, pair: str, trade, order: Order,
|
2022-03-25 18:46:56 +00:00
|
|
|
current_time: datetime, **kwargs) -> bool:
|
|
|
|
return False
|