Skip to content

Commit 89b6e69

Browse files
authored
Merge pull request freqtrade#12311 from freqtrade/fix/allow-override
fix: Allow users to override the exchange check for FreqAI incase the…
2 parents 8e44bc4 + 2d40807 commit 89b6e69

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

build_helpers/schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,11 @@
14611461
"type": "boolean",
14621462
"default": false
14631463
},
1464+
"override_exchange_check": {
1465+
"description": "Override the exchange check to force FreqAI to use exchanges that may not have enough historic data. Turn this to True if you know your FreqAI model and strategy do not require historical data.",
1466+
"type": "boolean",
1467+
"default": false
1468+
},
14641469
"feature_parameters": {
14651470
"description": "The parameters used to engineer the feature set",
14661471
"type": "object",

freqtrade/config_schema/config_schema.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,15 @@
11421142
"type": "boolean",
11431143
"default": False,
11441144
},
1145+
"override_exchange_check": {
1146+
"description": (
1147+
"Override the exchange check to force FreqAI to use exchanges "
1148+
"that may not have enough historic data. Turn this to True if "
1149+
"you know your FreqAI model and strategy do not require historical data."
1150+
),
1151+
"type": "boolean",
1152+
"default": False,
1153+
},
11451154
"feature_parameters": {
11461155
"description": "The parameters used to engineer the feature set",
11471156
"type": "object",

freqtrade/exchange/exchange.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,16 @@ def validate_orderflow(self, exchange: dict) -> None:
832832

833833
def validate_freqai(self, config: Config) -> None:
834834
freqai_enabled = config.get("freqai", {}).get("enabled", False)
835-
if freqai_enabled and not self._ft_has["ohlcv_has_history"]:
835+
override = config.get("freqai", {}).get("override_exchange_checks", False)
836+
if not override and freqai_enabled and not self._ft_has["ohlcv_has_history"]:
836837
raise ConfigurationError(
837838
f"Historic OHLCV data not available for {self.name}. Can't use freqAI."
838839
)
840+
elif override and freqai_enabled and not self._ft_has["ohlcv_has_history"]:
841+
logger.warning(
842+
"Overriding exchange checks for freqAI. Make sure that your exchange supports "
843+
"fetching historic OHLCV data, otherwise freqAI will not work."
844+
)
839845

840846
def validate_required_startup_candles(self, startup_candles: int, timeframe: str) -> int:
841847
"""

0 commit comments

Comments
 (0)