diff --git a/config_examples/config_freqai.example.json b/config_examples/config_freqai.example.json
index 13c7a94ea..846d37a82 100644
--- a/config_examples/config_freqai.example.json
+++ b/config_examples/config_freqai.example.json
@@ -56,6 +56,7 @@
"purge_old_models": true,
"train_period_days": 15,
"backtest_period_days": 7,
+ "backtest_save_model": true,
"live_retrain_hours": 0,
"identifier": "uniqe-id",
"feature_parameters": {
@@ -94,4 +95,4 @@
"internals": {
"process_throttle_secs": 5
}
-}
\ No newline at end of file
+}
diff --git a/docs/freqai.md b/docs/freqai.md
index 482a56d2b..6ee124b9b 100644
--- a/docs/freqai.md
+++ b/docs/freqai.md
@@ -93,6 +93,7 @@ Mandatory parameters are marked as **Required**, which means that they are requi
| `purge_old_models` | Delete obsolete models (otherwise, all historic models will remain on disk).
**Datatype:** Boolean. Default: `False`.
| `train_period_days` | **Required.**
Number of days to use for the training data (width of the sliding window).
**Datatype:** Positive integer.
| `backtest_period_days` | **Required.**
Number of days to inference from the trained model before sliding the window defined above, and retraining the model. This can be fractional days, but beware that the user-provided `timerange` will be divided by this number to yield the number of trainings necessary to complete the backtest.
**Datatype:** Float.
+| `backtest_save_model` | Saves models to disk when running backtesting.
**Datatype:** Boolean. Default: `True`.
| `identifier` | **Required.**
A unique name for the current model. This can be reused to reload pre-trained models/data.
**Datatype:** String.
| `live_retrain_hours` | Frequency of retraining during dry/live runs.
Default set to 0, which means the model will retrain as often as possible.
**Datatype:** Float > 0.
| `expiration_hours` | Avoid making predictions if a model is more than `expiration_hours` old.
Defaults set to 0, which means models never expire.
**Datatype:** Positive integer.
diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py
index 0a63e36ea..9c7ef05a7 100644
--- a/freqtrade/freqai/freqai_interface.py
+++ b/freqtrade/freqai/freqai_interface.py
@@ -71,6 +71,7 @@ class IFreqaiModel(ABC):
self.first = True
self.set_full_path()
self.follow_mode: bool = self.freqai_info.get("follow_mode", False)
+ self.backtest_save_model: bool = self.freqai_info.get("backtest_save_model", True)
self.dd = FreqaiDataDrawer(Path(self.full_path), self.config, self.follow_mode)
self.identifier: str = self.freqai_info.get("identifier", "no_id_provided")
self.scanning = False
@@ -246,7 +247,8 @@ class IFreqaiModel(ABC):
self.dd.pair_dict[metadata["pair"]]["trained_timestamp"] = int(
trained_timestamp.stopts)
dk.set_new_model_names(metadata["pair"], trained_timestamp)
- self.dd.save_data(self.model, metadata["pair"], dk)
+ if self.backtest_save_model:
+ self.dd.save_data(self.model, metadata["pair"], dk)
else:
self.model = self.dd.load_data(metadata["pair"], dk)