Graciously fail if strategy has freqAI code, but freqAI is not enabled.
This commit is contained in:
@@ -152,6 +152,13 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
|
||||
self.freqai = FreqaiModelResolver.load_freqaimodel(self.config)
|
||||
self.freqai_info = self.config["freqai"]
|
||||
else:
|
||||
# Gracious failures if freqAI is disabled but "start" is called.
|
||||
class DummyClass():
|
||||
def start(self, *args, **kwargs):
|
||||
raise OperationalException(
|
||||
'freqAI is not enabled. Please enable it in your config to use this strategy.')
|
||||
self.freqai = DummyClass() # type: ignore
|
||||
|
||||
def ft_bot_start(self, **kwargs) -> None:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user