freqtrade / freqtrade

Free, open source crypto trading bot

Home Page:https://www.freqtrade.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FreqAI: model not retraining itself.

campera88 opened this issue · comments

Describe your environment

  • Operating system: Ubuntu 20.04
  • Python Version: 3.9
  • CCXT version: 4.3.21
  • Freqtrade Version: 2024.5-dev-b1fd79d72

Your question

I developed a strategy for FreqAI and trained the model on a backtest to verify its functionality. After numerous attempts, it is now working properly.

Currently, the model is executing live trades as expected, but there is a small issue. The model is not retraining itself at all. The coin pairs' models in user_data/models/id are the same as those at the end of the backtest.

I even tried training a different model with a different ID and another configuration file, but nothing happened—it just performed a normal backtest. Although it created the folder user_data/models/newid, no further action occurred.

This is my config:

"freqai": {
        "enabled": true,
        "purge_old_models": 2,
        "train_period_days": 15,
        "backtest_period_days": 7,
        "live_retrain_hours": 0.5,
        "identifier": "id1",
        "save_backtest_models": true,
        "feature_parameters": {
            "include_timeframes": [
                "3m",
                "15m",
                "1h"
            ],
            "include_corr_pairlist": [
                "BTC/USDT",
                "ETH/USDT"
            ],
            "label_period_candles": 20,
            "include_shifted_candles": 2,
            "DI_threshold": 0.9,
            "weight_factor": 0.9,
            "principal_component_analysis": false,
            "use_SVM_to_remove_outliers": true,
            "indicator_periods_candles": [
                10,
                20
            ],
            "plot_feature_importances": 0
        },
        "data_split_parameters": {
            "test_size": 0.33,
            "random_state": 1
        },
        "model_training_parameters": {}
    },

Any idea? Thanks in advance.

Please provide more information. Right now we are unable to assist since you are not providing any evidence for why you believe it’s not training or retraining.

Actually, your statements are just confusing, your final paragraph indicates that FreqAI is not training any models at all. But your title and first paragraph say it’s just not “retraining” but that it’s working.

Consider running the quick start command and reporting to us your observations plus logs. Otherwise, nothing we can do to help you.

https://www.freqtrade.io/en/latest/freqai/#quick-start

Thank you very much for the response.

I did not explain myself well. The bot is operating and making trades in a live run for over 24 hours with the command: freqtrade trade --config user_data/myconfig.json --strategy Strategy --freqaimodel LightGBMRegressor

I know that FreqAI is not retraining any model because the bot is behaving like a normal bot and the files inside the directory of the id are from the last backtest I did, and it is set to train the models every 30 minutes.

Running it with the sample strategy and sample config works as expected.

I also tried my configuration with the FreqAI sample strategy, using a new ID, and the models are being trained. Could there be an issue with my strategy code that prevents FreqAI from retraining the models?

Could there be an issue with my strategy code that prevents FreqAI from retraining the models?

There is no way to answer your question. You are asking us if there is a problem with your strategy, but not sharing your strategy.