From f631ae911b82e11cb4621528f2a2131b56a98c9c Mon Sep 17 00:00:00 2001 From: robcaulk Date: Fri, 17 Jun 2022 14:55:40 +0200 Subject: [PATCH] add model expiration feature, fix bug in DI return values --- docs/freqai.md | 18 ++++++++++ freqtrade/freqai/data_drawer.py | 20 +++++++---- freqtrade/freqai/data_kitchen.py | 12 +++++-- freqtrade/freqai/freqai_interface.py | 35 ++++++++++++++----- .../CatboostPredictionModel.py | 2 +- 5 files changed, 69 insertions(+), 18 deletions(-) diff --git a/docs/freqai.md b/docs/freqai.md index 8d54a7535..647ffcecd 100644 --- a/docs/freqai.md +++ b/docs/freqai.md @@ -452,6 +452,24 @@ config: which will automatically purge all models older than the two most recently trained ones. +## Defining model expirations + +During dry/live, FreqAI trains each pair sequentially (on separate threads/GPU from the main +Freqtrade bot). This means there is always an age discrepancy between models. If a user is training +on 50 pairs, and each pair requires 5 minutes to train, the oldest model will be over 4 hours old. +This may be undesirable if the characteristic time scale (read trade duration target) for a strategy +is much less than 4 hours. The user can decide to only make trade entries if the model is less than +a certain number of hours in age by setting the `expiration_hours` in the config file: + +```json + "freqai": { + "expiration_hours": 0.5, + } +``` + +In the present example, the user will only allow predictions on models that are less than 1/2 hours +old. +