freqtrade / freqtrade

Free, open source crypto trading bot
https://www.freqtrade.io
GNU General Public License v3.0
30.37k stars 6.3k forks source link

Error during backtesting QuickAdapterV3 KeyError: '&s-extrema' #10654

Closed luca-palese closed 2 months ago

luca-palese commented 2 months ago

Describe your environment

Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.

Describe the problem:

Explain the problem you have encountered Hello, first of all, thanks for all your amazing work and support! I’ve just started working with FreqAI and I’m still trying to grasp everything.

While running backtesting, I either encounter an error, or the backtesting finishes, but no trades are made. I made small modifications to the config file to reduce the amount of data processed during training, but nothing else. I also tried backtesting without the confirm_trade_entry function because it calls Trade.get_trades(), which is not supported in backtesting. I haven’t touched the XGBRegressor file, even though the error seems to originate from there.

Steps to reproduce:

  1. Backtest the strategy

Observed Results:

I either get the error or no trades are made

Relevant code exceptions or logs

The logs

docker compose -f docker-compose-ai.yml run --rm freqtrade backtesting --config user_data/config_ai.json --strategy QuickAdapterV3 --freqaimodel XGBoostRegressorQuickAdapterV3 --timerange 20240501-20240510
2024-09-15 16:46:17,738 - freqtrade - INFO - freqtrade 2024.7.1
2024-09-15 16:46:17,763 - freqtrade.configuration.load_config - INFO - Using config: user_data/config_ai.json ...
2024-09-15 16:46:17,770 - freqtrade.loggers - INFO - Verbosity set to 0
2024-09-15 16:46:17,770 - freqtrade.configuration.configuration - WARNING - `force_entry_enable` RPC message enabled.
2024-09-15 16:46:17,771 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 3 ...
2024-09-15 16:46:17,771 - freqtrade.configuration.configuration - INFO - Parameter --timerange detected: 20240501-20240510 ...
2024-09-15 16:46:18,149 - freqtrade.configuration.configuration - INFO - Using user-data directory: /freqtrade/user_data ...
2024-09-15 16:46:18,153 - freqtrade.configuration.configuration - INFO - Using data directory: /freqtrade/user_data/data/binance ...
2024-09-15 16:46:18,153 - freqtrade.configuration.configuration - INFO - Parameter --cache=day detected ...
2024-09-15 16:46:18,153 - freqtrade.configuration.configuration - INFO - Filter trades by timerange: 20240501-20240510
2024-09-15 16:46:18,153 - freqtrade.configuration.configuration - INFO - Using freqaimodel class name: XGBoostRegressorQuickAdapterV3
2024-09-15 16:46:18,155 - freqtrade.exchange.check_exchange - INFO - Checking exchange...
2024-09-15 16:46:18,171 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team.
2024-09-15 16:46:18,171 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration.
2024-09-15 16:46:18,171 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2024-09-15 16:46:18,176 - freqtrade.commands.optimize_commands - INFO - Starting freqtrade in Backtesting mode
2024-09-15 16:46:18,176 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2024-09-15 16:46:18,176 - freqtrade.exchange.exchange - INFO - Using CCXT 4.3.65
2024-09-15 16:46:18,177 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-09-15 16:46:18,190 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-09-15 16:46:18,206 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance"
2024-09-15 16:46:21,060 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'...
2024-09-15 16:46:21,676 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/GodStra.py due to 'No module named 'ta''
2024-09-15 16:46:21,696 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/Heracles.py due to 'No module named 'ta''
2024-09-15 16:46:21,771 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/MacheteV8b_Fixed.py due to 'No module named 'finta''
2024-09-15 16:46:22,326 - freqtrade.resolvers.iresolver - INFO - Using resolved strategy QuickAdapterV3 from '/freqtrade/user_data/strategies/QuickAdapterV3.py'...
2024-09-15 16:46:22,328 - freqtrade.strategy.hyper - INFO - Found no parameter file.
2024-09-15 16:46:22,329 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'timeframe' with value in config file: 3m.
2024-09-15 16:46:22,329 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_currency' with value in config file: USDT.
2024-09-15 16:46:22,329 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_amount' with value in config file: unlimited.
2024-09-15 16:46:22,329 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'unfilledtimeout' with value in config file: {'entry': 10, 'exit': 30, 'exit_timeout_count': 0, 'unit': 'minutes'}.
2024-09-15 16:46:22,329 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'max_open_trades' with value in config file: 3.
2024-09-15 16:46:22,329 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using minimal_roi: {'0': 0.03, '5000': -1}
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using timeframe: 3m
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stoploss: -0.04
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop: False
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop_positive_offset: 0.0
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_only_offset_is_reached: False
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using use_custom_stoploss: False
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using process_only_new_candles: True
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_types: {'entry': 'limit', 'exit': 'market', 'emergency_exit': 'market', 'force_exit': 'market', 'force_entry': 'market', 'stoploss': 'market', 'stoploss_on_exchange': False, 'stoploss_on_exchange_interval': 120}
2024-09-15 16:46:22,330 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_time_in_force: {'entry': 'GTC', 'exit': 'GTC'}
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_currency: USDT
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_amount: unlimited
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using protections: [{'method': 'CooldownPeriod', 'stop_duration_candles': 4}, {'method': 'MaxDrawdown', 'lookback_period_candles': 48, 'trade_limit': 20, 'stop_duration_candles': 4, 'max_allowed_drawdown': 0.2}]
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using startup_candle_count: 80
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using unfilledtimeout: {'entry': 10, 'exit': 30, 'exit_timeout_count': 0, 'unit': 'minutes'}
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using use_exit_signal: True
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using exit_profit_only: False
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ignore_roi_if_entry_signal: False
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using exit_profit_offset: 0.0
2024-09-15 16:46:22,331 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using disable_dataframe_checks: False
2024-09-15 16:46:22,332 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ignore_buying_expired_candle_after: 0
2024-09-15 16:46:22,332 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using position_adjustment_enable: False
2024-09-15 16:46:22,332 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using max_entry_position_adjustment: 1
2024-09-15 16:46:22,332 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using max_open_trades: 3
2024-09-15 16:46:22,332 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2024-09-15 16:46:22,370 - freqtrade.resolvers.iresolver - INFO - Using resolved pairlist StaticPairList from '/freqtrade/freqtrade/plugins/pairlist/StaticPairList.py'...
2024-09-15 16:46:22,389 - freqtrade.optimize.backtesting - INFO - Using fee 0.0500% - worst case fee from exchange (lowest tier).
2024-09-15 16:46:22,390 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 3m to 6800
2024-09-15 16:46:22,410 - freqtrade.data.history.history_utils - INFO - Using indicator startup period: 6800 ...
2024-09-15 16:46:23,336 - freqtrade.optimize.backtesting - INFO - Loading data from 2024-04-16 20:00:00 up to 2024-05-10 00:00:00 (23 days).
2024-09-15 16:46:23,650 - freqtrade.optimize.backtesting - INFO - Dataload complete. Calculating indicators
2024-09-15 16:46:23,705 - freqtrade.optimize.backtesting - INFO - Running backtesting for Strategy QuickAdapterV3
2024-09-15 16:46:23,968 - freqtrade.resolvers.iresolver - INFO - Using resolved freqaimodel XGBoostRegressorQuickAdapterV3 from '/freqtrade/user_data/freqaimodels/XGBoostRegressorQuickAdapterV3.py'...
2024-09-15 16:46:23,973 - freqtrade.freqai.freqai_interface - INFO - Backtesting module configured to save all models.
2024-09-15 16:46:23,985 - freqtrade.freqai.data_drawer - INFO - Could not find existing historic_predictions, starting from scratch
2024-09-15 16:46:23,988 - freqtrade.freqai.data_drawer - INFO - Could not find existing metric tracker, starting from scratch
2024-09-15 16:46:23,988 - freqtrade.freqai.freqai_interface - INFO - Set existing queue from trained timestamps. Best approximation queue: {best_queue}
2024-09-15 16:46:24,010 - freqtrade.strategy.hyper - INFO - No params for buy found, using default values.
2024-09-15 16:46:24,011 - freqtrade.strategy.hyper - INFO - No params for sell found, using default values.
2024-09-15 16:46:24,011 - freqtrade.strategy.hyper - INFO - No params for protection found, using default values.
2024-09-15 16:46:24,020 - freqtrade.freqai.freqai_interface - INFO - Training 5 timeranges
2024-09-15 16:46:24,023 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/4 pairs from 2024-04-17 00:00:00 to 2024-05-01 00:00:00, 1/5 trains
2024-09-15 16:46:24,043 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1714521600_prediction.feather
2024-09-15 16:46:24,161 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 5m to 4112
2024-09-15 16:46:24,161 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 5m from 2024-04-16 17:20:00 to 2024-05-10 00:00:00
2024-09-15 16:46:24,918 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 15m to 1424
2024-09-15 16:46:24,918 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 15m from 2024-04-16 04:00:00 to 2024-05-10 00:00:00
2024-09-15 16:46:25,235 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 1h to 416
2024-09-15 16:46:25,235 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 1h from 2024-04-13 16:00:00 to 2024-05-10 00:00:00
2024-09-15 16:46:25,418 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/4 pairs from 2024-04-19 00:00:00 to 2024-05-03 00:00:00, 2/5 trains
2024-09-15 16:46:25,437 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1714694400_prediction.feather
2024-09-15 16:46:25,453 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/4 pairs from 2024-04-21 00:00:00 to 2024-05-05 00:00:00, 3/5 trains
2024-09-15 16:46:25,470 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1714867200_prediction.feather
2024-09-15 16:46:25,485 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/4 pairs from 2024-04-23 00:00:00 to 2024-05-07 00:00:00, 4/5 trains
2024-09-15 16:46:25,501 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1715040000_prediction.feather
2024-09-15 16:46:25,516 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/4 pairs from 2024-04-25 00:00:00 to 2024-05-09 00:00:00, 5/5 trains
2024-09-15 16:46:25,533 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1715212800_prediction.feather
2024-09-15 16:46:25,544 - freqtrade.freqai.freqai_interface - INFO - Applying fit_live_predictions in backtesting
2024-09-15 16:46:25,607 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
  File "/freqtrade/freqtrade/main.py", line 43, in main
    return_code = args["func"](args)
                  ^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/commands/optimize_commands.py", line 60, in start_backtesting
    backtesting.start()
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 1614, in start
    min_date, max_date = self.backtest_one_strategy(strat, data, timerange)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 1524, in backtest_one_strategy
    preprocessed = self.strategy.advise_all_indicators(data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/interface.py", line 1587, in advise_all_indicators
    pair: self.advise_indicators(pair_data.copy(), {"pair": pair}).copy()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/interface.py", line 1645, in advise_indicators
    return self.populate_indicators(dataframe, metadata)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/user_data/strategies/QuickAdapterV3.py", line 239, in populate_indicators
    dataframe = self.freqai.start(dataframe, metadata, self)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/freqai/freqai_interface.py", line 161, in start
    dk = self.start_backtesting(dataframe, metadata, self.dk, strategy)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/freqai/freqai_interface.py", line 387, in start_backtesting
    self.backtesting_fit_live_predictions(dk)
  File "/freqtrade/freqtrade/freqai/freqai_interface.py", line 891, in backtesting_fit_live_predictions
    dk.full_df.at[index, f"{label}_mean"] = self.dk.data["labels_mean"][
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '&s-extrema'

The config:

{
    "trading_mode": "futures",
    "margin_mode": "isolated",
    "max_open_trades": 3,
    "stake_currency": "USDT",
    "stake_amount": "unlimited",
    "tradable_balance_ratio": 0.1,
    "fiat_display_currency": "USD",
    "dry_run": true,
    "timeframe": "3m",
    "dry_run_wallet": 1000,
    "cancel_open_orders_on_exit": true,
    "unfilledtimeout": {
        "entry": 10,
        "exit": 30
    },
    "exchange": {
        "name": "binance",
        "key": "",
        "secret": "",
        "ccxt_config": {},
        "ccxt_async_config": {},
        "pair_whitelist": [
            "BTC/USDT:USDT","SOL/USDT:USDT","BNB/USDT:USDT","ETH/USDT:USDT"
        ],
        "pair_blacklist": []
    },
    "entry_pricing": {
        "price_side": "same",
        "use_order_book": true,
        "order_book_top": 1,
        "price_last_balance": 0.0,
        "check_depth_of_market": {
            "enabled": false,
            "bids_to_ask_delta": 1
        }
    },
    "exit_pricing": {
        "price_side": "other",
        "use_order_book": true,
        "order_book_top": 1
    },
    "pairlists": [
        {
            "method": "StaticPairList"
        }
    ],

 "freqai": {
            "enabled": true,
            "conv_width": 1,
            "purge_old_models": 5,
            "expiration_hours": 10,
            "train_period_days": 14,
            "backtest_period_days": 2,
            "write_metrics_to_disk": true,
            "identifier": "quickadapter-xgboost",
            "fit_live_predictions_candles": 600,
            "data_kitchen_thread_count": 10,
            "track_performance": true,
            "extra_returns_per_train": {"DI_value_param1":0, "DI_value_param2":0, "DI_value_param3":0, "DI_cutoff": 2, "&s-minima_sort_threshold":-2, "&s-maxima_sort_threshold":2},
            "feature_parameters": {
                "include_corr_pairlist": [
                ],
                "include_timeframes": [
                    "5m",
                    "15m",
                    "1h"
                ],
                "label_period_candles": 100,
                "include_shifted_candles": 3,
                "DI_threshold": 10,
                "weight_factor": 0.9,
                "principal_component_analysis": false,
                "use_SVM_to_remove_outliers": false,
                "use_DBSCAN_to_remove_outliers": false,
                "indicator_periods_candles": [8, 16, 32],
                "inlier_metric_window": 0,
                "noise_standard_deviation": 0.02,
                "reverse_test_train_order": false,
                "plot_feature_importances": 0,
                "buffer_train_data_candles": 100
            },
            "data_split_parameters": {
                "test_size": 0,
                "random_state": 1,
                "shuffle": false
            },
            "model_training_parameters": {
                "n_jobs": 10,
                "verbosity": 1
     }      
 },
"bot_name": "",
 "force_entry_enable": true,
"initial_state": "running",
    "internals": {
        "process_throttle_secs": 5
    },
"telegram": {
        "enabled": true,
        "token": "your_telegram_token",
        "chat_id": "your_telegram_chat_id"
    },
"api_server": {
        "enabled": true,
        "listen_ip_address": "0.0.0.0",
        "listen_port": 8080,
        "verbosity": "error",
        "jwt_secret_key": "somethingrandom",
        "CORS_origins": [],
        "username": "freqtrader",
        "password": "SuperSecurePassword"
 }
}

The strat:

import logging
from functools import reduce
import datetime
from datetime import timedelta
import talib.abstract as ta
from pandas import DataFrame, Series
from technical import qtpylib
from typing import Optional
from freqtrade.strategy.interface import IStrategy
from technical.pivots_points import pivots_points
from freqtrade.exchange import timeframe_to_prev_date
from freqtrade.persistence import Trade
from scipy.signal import argrelextrema
import numpy as np
import pandas_ta as pta

logger = logging.getLogger(__name__)

class QuickAdapterV3(IStrategy):
    """
    The following freqaimodel is released to sponsors of the non-profit FreqAI open-source project.
    If you find the FreqAI project useful, please consider supporting it by becoming a sponsor.
    We use sponsor money to help stimulate new features and to pay for running these public
    experiments, with a an objective of helping the community make smarter choices in their
    ML journey.

    This strategy is experimental (as with all strategies released to sponsors). Do *not* expect
    returns. The goal is to demonstrate gratitude to people who support the project and to
    help them find a good starting point for their own creativity.

    If you have questions, please direct them to our discord: https://discord.gg/xE4RMg4QYw

    https://github.com/sponsors/robcaulk
    """

    position_adjustment_enable = False

    # Attempts to handle large drops with DCA. High stoploss is required.
    stoploss = -0.04

    order_types = {
        "entry": "limit",
        "exit": "market",
        "emergency_exit": "market",
        "force_exit": "market",
        "force_entry": "market",
        "stoploss": "market",
        "stoploss_on_exchange": False,
        "stoploss_on_exchange_interval": 120,
    }

    # # Example specific variables
    max_entry_position_adjustment = 1
    # # This number is explained a bit further down
    max_dca_multiplier = 2

    minimal_roi = {"0": 0.03, "5000": -1}

    process_only_new_candles = True

    can_short = True

    plot_config = {
        "main_plot": {},
        "subplots": {
            "accuracy": {
                "accuracy_score": {
                    "color": "#c28ce3",
                    "type": "line"
                }
            },
            "extrema": {
                "&s-extrema": {
                    "color": "#f53580",
                    "type": "line"
                },
                "&s-minima_sort_threshold": {
                    "color": "#4ae747",
                    "type": "line"
                },
                "&s-maxima_sort_threshold": {
                    "color": "#5b5e4b",
                    "type": "line"
                }
            },
            "min_max": {
                "maxima": {
                    "color": "#a29db9",
                    "type": "line"
                },
                "minima": {
                    "color": "#ac7fc",
                    "type": "bar"
                }
            }
        }
    }

    @property
    def protections(self):
        return [
            {"method": "CooldownPeriod", "stop_duration_candles": 4},
            {
                "method": "MaxDrawdown",
                "lookback_period_candles": 48,
                "trade_limit": 20,
                "stop_duration_candles": 4,
                "max_allowed_drawdown": 0.2,
            },
            # {
            #     "method": "StoplossGuard",
            #     "lookback_period_candles": 300,
            #     "trade_limit": 1,
            #     "stop_duration_candles": 300,
            #     "only_per_pair": True,
            # },
        ]

    use_exit_signal = True
    startup_candle_count: int = 80

    # # Trailing stop:
    # trailing_stop = True
    # trailing_stop_positive = 0.01
    # trailing_stop_positive_offset = 0.025
    # trailing_only_offset_is_reached = True

    def feature_engineering_expand_all(self, dataframe, period, **kwargs):
        dataframe["%-rsi-period"] = ta.RSI(dataframe, timeperiod=period)
        dataframe["%-mfi-period"] = ta.MFI(dataframe, timeperiod=period)
        dataframe["%-adx-period"] = ta.ADX(dataframe, window=period)
        dataframe["%-cci-period"] = ta.CCI(dataframe, timeperiod=period)
        dataframe["%-er-period"] = pta.er(dataframe['close'], length=period)
        dataframe["%-rocr-period"] = ta.ROCR(dataframe, timeperiod=period)
        dataframe["%-cmf-period"] = chaikin_mf(dataframe, periods=period)
        dataframe["%-tcp-period"] = top_percent_change(dataframe, period)
        dataframe["%-cti-period"] = pta.cti(dataframe['close'], length=period)
        dataframe["%-chop-period"] = qtpylib.chopiness(dataframe, period)
        dataframe["%-linear-period"] = ta.LINEARREG_ANGLE(
            dataframe['close'], timeperiod=period)
        dataframe["%-atr-period"] = ta.ATR(dataframe, timeperiod=period)
        dataframe["%-atr-periodp"] = dataframe["%-atr-period"] / \
            dataframe['close'] * 1000
        return dataframe

    def feature_engineering_expand_basic(self, dataframe, **kwargs):
        dataframe["%-pct-change"] = dataframe["close"].pct_change()
        dataframe["%-raw_volume"] = dataframe["volume"]
        dataframe["%-obv"] = ta.OBV(dataframe)
        # Added
        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=14, stds=2.2)
        dataframe["bb_lowerband"] = bollinger["lower"]
        dataframe["bb_middleband"] = bollinger["mid"]
        dataframe["bb_upperband"] = bollinger["upper"]
        dataframe["%-bb_width"] = (dataframe["bb_upperband"] -
                                   dataframe["bb_lowerband"]) / dataframe["bb_middleband"]
        dataframe["%-ibs"] = ((dataframe['close'] - dataframe['low']) /
                              (dataframe['high'] - dataframe['low']))
        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)
        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)
        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)
        dataframe['%-distema50'] = get_distance(dataframe['close'], dataframe['ema_50'])
        dataframe['%-distema12'] = get_distance(dataframe['close'], dataframe['ema_12'])
        dataframe['%-distema26'] = get_distance(dataframe['close'], dataframe['ema_26'])
        macd = ta.MACD(dataframe)
        dataframe['%-macd'] = macd['macd']
        dataframe['%-macdsignal'] = macd['macdsignal']
        dataframe['%-macdhist'] = macd['macdhist']
        dataframe['%-dist_to_macdsignal'] = get_distance(
            dataframe['%-macd'], dataframe['%-macdsignal'])
        dataframe['%-dist_to_zerohist'] = get_distance(0, dataframe['%-macdhist'])
        # VWAP
        vwap_low, vwap, vwap_high = VWAPB(dataframe, 20, 1)
        dataframe['vwap_upperband'] = vwap_high
        dataframe['vwap_middleband'] = vwap
        dataframe['vwap_lowerband'] = vwap_low
        dataframe['%-vwap_width'] = ((dataframe['vwap_upperband'] -
                                     dataframe['vwap_lowerband']) / dataframe['vwap_middleband']) * 100
        dataframe = dataframe.copy()
        dataframe['%-dist_to_vwap_upperband'] = get_distance(
            dataframe['close'], dataframe['vwap_upperband'])
        dataframe['%-dist_to_vwap_middleband'] = get_distance(
            dataframe['close'], dataframe['vwap_middleband'])
        dataframe['%-dist_to_vwap_lowerband'] = get_distance(
            dataframe['close'], dataframe['vwap_lowerband'])
        dataframe['%-tail'] = (dataframe['close'] - dataframe['low']).abs()
        dataframe['%-wick'] = (dataframe['high'] - dataframe['close']).abs()
        pp = pivots_points(dataframe)
        dataframe['pivot'] = pp['pivot']
        dataframe['r1'] = pp['r1']
        dataframe['s1'] = pp['s1']
        dataframe['r2'] = pp['r2']
        dataframe['s2'] = pp['s2']
        dataframe['r3'] = pp['r3']
        dataframe['s3'] = pp['s3']
        dataframe['rawclose'] = dataframe['close']
        dataframe['%-dist_to_r1'] = get_distance(dataframe['close'], dataframe['r1'])
        dataframe['%-dist_to_r2'] = get_distance(dataframe['close'], dataframe['r2'])
        dataframe['%-dist_to_r3'] = get_distance(dataframe['close'], dataframe['r3'])
        dataframe['%-dist_to_s1'] = get_distance(dataframe['close'], dataframe['s1'])
        dataframe['%-dist_to_s2'] = get_distance(dataframe['close'], dataframe['s2'])
        dataframe['%-dist_to_s3'] = get_distance(dataframe['close'], dataframe['s3'])
        dataframe["%-pct-change"] = dataframe["close"].pct_change()
        dataframe["%-raw_volume"] = dataframe["volume"]
        dataframe["%-raw_price"] = dataframe["close"]
        dataframe["%-raw_open"] = dataframe["open"]
        dataframe["%-raw_low"] = dataframe["low"]
        dataframe["%-raw_high"] = dataframe["high"]
        return dataframe

    def feature_engineering_standard(self, dataframe, **kwargs):
        dataframe["%-day_of_week"] = (dataframe["date"].dt.dayofweek + 1) / 7
        dataframe["%-hour_of_day"] = (dataframe["date"].dt.hour + 1) / 25
        return dataframe

    def set_freqai_targets(self, dataframe, **kwargs):
        dataframe["&s-extrema"] = 0
        min_peaks = argrelextrema(
            dataframe["low"].values, np.less,
            order=self.freqai_info["feature_parameters"]["label_period_candles"]
        )
        max_peaks = argrelextrema(
            dataframe["high"].values, np.greater,
            order=self.freqai_info["feature_parameters"]["label_period_candles"]
        )
        for mp in min_peaks[0]:
            dataframe.at[mp, "&s-extrema"] = -1
        for mp in max_peaks[0]:
            dataframe.at[mp, "&s-extrema"] = 1
        dataframe["minima"] = np.where(dataframe["&s-extrema"] == -1, 1, 0)
        dataframe["maxima"] = np.where(dataframe["&s-extrema"] == 1, 1, 0)
        dataframe['&s-extrema'] = dataframe['&s-extrema'].rolling(
            window=5, win_type='gaussian', center=True).mean(std=0.5)
        return dataframe

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:

        dataframe = self.freqai.start(dataframe, metadata, self)

        dataframe["DI_catch"] = np.where(
            dataframe["DI_values"] > dataframe["DI_cutoff"], 0, 1,
        )

        dataframe["minima_sort_threshold"] = dataframe["&s-minima_sort_threshold"]
        dataframe["maxima_sort_threshold"] = dataframe["&s-maxima_sort_threshold"]
        return dataframe

    def populate_entry_trend(self, df: DataFrame, metadata: dict) -> DataFrame:

        enter_long_conditions = [
            df["do_predict"] == 1,
            df["DI_catch"] == 1,
            df["&s-extrema"] < df["minima_sort_threshold"],
        ]

        if enter_long_conditions:
            df.loc[
                reduce(lambda x, y: x & y, enter_long_conditions), [
                    "enter_long", "enter_tag"]
            ] = (1, "long")

        enter_short_conditions = [
            df["do_predict"] == 1,
            df["DI_catch"] == 1,
            df["&s-extrema"] > df["maxima_sort_threshold"],
        ]

        if enter_short_conditions:
            df.loc[
                reduce(lambda x, y: x & y, enter_short_conditions), [
                    "enter_short", "enter_tag"]
            ] = (1, "short")

        return df

    def populate_exit_trend(self, df: DataFrame, metadata: dict) -> DataFrame:

        return df

    def custom_exit(
        self,
        pair: str,
        trade: Trade,
        current_time: datetime,
        current_rate: float,
        current_profit: float,
        **kwargs
    ):

        dataframe, _ = self.dp.get_analyzed_dataframe(
            pair=pair, timeframe=self.timeframe)

        last_candle = dataframe.iloc[-1].squeeze()
        trade_date = timeframe_to_prev_date(
            self.timeframe, (trade.open_date_utc -
                             timedelta(minutes=int(self.timeframe[:-1])))
        )
        trade_candle = dataframe.loc[(dataframe["date"] == trade_date)]
        if trade_candle.empty:
            return None
        trade_candle = trade_candle.squeeze()

        entry_tag = trade.enter_tag

        trade_duration = (current_time - trade.open_date_utc).seconds / 60

        if trade_duration > 1000:
            return "trade expired"

        if last_candle["DI_catch"] == 0:
            return "Outlier detected"

        if (
            last_candle["&s-extrema"] < last_candle["minima_sort_threshold"]
            and entry_tag == "short"
        ):
            return "minimia_detected_short"

        if (
            last_candle["&s-extrema"] > last_candle["maxima_sort_threshold"]
            and entry_tag == "long"
        ):
            return "maxima_detected_long"

    def confirm_trade_entry(
        self,
        pair: str,
        order_type: str,
        amount: float,
        rate: float,
        time_in_force: str,
        current_time: datetime,
        entry_tag: Optional[str],
        side: str,
        **kwargs
    ) -> bool:

        open_trades = Trade.get_trades(trade_filter=Trade.is_open.is_(True))

        num_shorts, num_longs = 0, 0
        for trade in open_trades:
            if "short" in trade.enter_tag:
                num_shorts += 1
            elif "long" in trade.enter_tag:
                num_longs += 1

        if side == "long" and num_longs >= 5:
            return False

        if side == "short" and num_shorts >= 5:
            return False

        df, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
        last_candle = df.iloc[-1].squeeze()

        if side == "long":
            if rate > (last_candle["close"] * (1 + 0.0025)):
                return False
        else:
            if rate < (last_candle["close"] * (1 - 0.0025)):
                return False

        return True

def top_percent_change(dataframe: DataFrame, length: int) -> float:
    """
    Percentage change of the current close from the range maximum Open price
    :param dataframe: DataFrame The original OHLC dataframe
    :param length: int The length to look back
    """
    if length == 0:
        return (dataframe['open'] - dataframe['close']) / dataframe['close']
    else:
        return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']

def chaikin_mf(df, periods=20):
    close = df['close']
    low = df['low']
    high = df['high']
    volume = df['volume']
    mfv = ((close - low) - (high - close)) / (high - low)
    mfv = mfv.fillna(0.0)
    mfv *= volume
    cmf = mfv.rolling(periods).sum() / volume.rolling(periods).sum()
    return Series(cmf, name='cmf')

def VWAPB(dataframe, window_size=20, num_of_std=1):
    df = dataframe.copy()
    df['vwap'] = qtpylib.rolling_vwap(df, window=window_size)
    rolling_std = df['vwap'].rolling(window=window_size).std()
    df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)
    df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)
    return df['vwap_low'], df['vwap'], df['vwap_high']

def EWO(dataframe, sma_length=5, sma2_length=35):
    df = dataframe.copy()
    sma1 = ta.EMA(df, timeperiod=sma_length)
    sma2 = ta.EMA(df, timeperiod=sma2_length)
    smadif = (sma1 - sma2) / df['close'] * 100
    return smadif

def get_distance(p1, p2):
    return abs((p1) - (p2))

The model:

import logging
from typing import Any, Dict, Tuple

from xgboost import XGBRegressor
import time
from freqtrade.freqai.base_models.BaseRegressionModel import BaseRegressionModel
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
import pandas as pd
import scipy as spy
import numpy.typing as npt
from pandas import DataFrame
import numpy as np

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

logger = logging.getLogger(__name__)

class XGBoostRegressorQuickAdapterV3(BaseRegressionModel):
    """
    The following freqaimodel is released to sponsors of the non-profit FreqAI open-source project.
    If you find the FreqAI project useful, please consider supporting it by becoming a sponsor.
    We use sponsor money to help stimulate new features and to pay for running these public
    experiments, with a an objective of helping the community make smarter choices in their
    ML journey.

    This strategy is experimental (as with all strategies released to sponsors). Do *not* expect
    returns. The goal is to demonstrate gratitude to people who support the project and to
    help them find a good starting point for their own creativity.

    If you have questions, please direct them to our discord: https://discord.gg/xE4RMg4QYw

    https://github.com/sponsors/robcaulk
    """

    def fit(self, data_dictionary: Dict, dk: FreqaiDataKitchen, **kwargs) -> Any:
        """
        User sets up the training and test data to fit their desired model here
        :param data_dictionary: the dictionary constructed by DataHandler to hold
                                all the training and test data/labels.
        """

        X = data_dictionary["train_features"]
        y = data_dictionary["train_labels"]

        if self.freqai_info.get("data_split_parameters", {}).get("test_size", 0.1) == 0:
            eval_set = None
            eval_weights = None
        else:
            eval_set = [(data_dictionary["test_features"], data_dictionary["test_labels"])]
            eval_weights = [data_dictionary['test_weights']]

        sample_weight = data_dictionary["train_weights"]

        xgb_model = self.get_init_model(dk.pair)

        model = XGBRegressor(**self.model_training_parameters)

        start = time.time()
        model.fit(X=X, y=y, sample_weight=sample_weight, eval_set=eval_set,
                  sample_weight_eval_set=eval_weights, xgb_model=xgb_model)
        time_spent = (time.time() - start)
        self.dd.update_metric_tracker('fit_time', time_spent, dk.pair)

        return model

    def fit_live_predictions(self, dk: FreqaiDataKitchen, pair: str) -> None:

        warmed_up = True

        num_candles = self.freqai_info.get('fit_live_predictions_candles', 100)
        if self.live:
            if not hasattr(self, 'exchange_candles'):
                self.exchange_candles = len(self.dd.model_return_values[pair].index)
            candle_diff = len(self.dd.historic_predictions[pair].index) - \
                (num_candles + self.exchange_candles)
            if candle_diff < 0:
                logger.warning(
                    f'Fit live predictions not warmed up yet. Still {abs(candle_diff)} candles to go')
                warmed_up = False

        pred_df_full = self.dd.historic_predictions[pair].tail(num_candles).reset_index(drop=True)
        pred_df_sorted = pd.DataFrame()
        for label in pred_df_full.keys():
            if pred_df_full[label].dtype == object:
                continue
            pred_df_sorted[label] = pred_df_full[label]

        # pred_df_sorted = pred_df_sorted
        for col in pred_df_sorted:
            pred_df_sorted[col] = pred_df_sorted[col].sort_values(
                ascending=False, ignore_index=True)
        frequency = num_candles / (self.freqai_info['feature_parameters']['label_period_candles'] * 2)
        max_pred = pred_df_sorted.iloc[:int(frequency)].mean()
        min_pred = pred_df_sorted.iloc[-int(frequency):].mean()

        if not warmed_up:
            dk.data['extra_returns_per_train']['&s-maxima_sort_threshold'] = 2
            dk.data['extra_returns_per_train']['&s-minima_sort_threshold'] = -2
        else:
            dk.data['extra_returns_per_train']['&s-maxima_sort_threshold'] = max_pred['&s-extrema']
            dk.data['extra_returns_per_train']['&s-minima_sort_threshold'] = min_pred['&s-extrema']

        dk.data["labels_mean"], dk.data["labels_std"] = {}, {}
        for ft in dk.label_list:
            # f = spy.stats.norm.fit(pred_df_full[ft])
            dk.data['labels_std'][ft] = 0  # f[1]
            dk.data['labels_mean'][ft] = 0  # f[0]

        # fit the DI_threshold
        if not warmed_up:
            f = [0, 0, 0]
            cutoff = 2
        else:
            f = spy.stats.weibull_min.fit(pred_df_full['DI_values'])
            cutoff = spy.stats.weibull_min.ppf(0.999, *f)

        dk.data["DI_value_mean"] = pred_df_full['DI_values'].mean()
        dk.data["DI_value_std"] = pred_df_full['DI_values'].std()
        dk.data['extra_returns_per_train']['DI_value_param1'] = f[0]
        dk.data['extra_returns_per_train']['DI_value_param2'] = f[1]
        dk.data['extra_returns_per_train']['DI_value_param3'] = f[2]
        dk.data['extra_returns_per_train']['DI_cutoff'] = cutoff
robcaulk commented 2 months ago

Hello,

QV3 is not backtestable like this, you need the backtestable version of the file, which is available in the FreqAI discord in the #strats-library channel.

However, in general, this is a very computationally intense strategy to backtest. It is recommended to run dry instead.

Cheers,

Rob

luca-palese commented 2 months ago

It is the backtestable model; here you can see what I was referring earlier, either the key error or no trades are made.

C:\Users\Luca Palese\ft_userdata>docker compose -f docker-compose-ai.yml run --rm freqtrade backtesting --config user_data/config.json --strategy QuickAdapterV3 --freqaimodel XGBoostRegressorQuickAdapterV3 --timerange 20240501-20240505
2024-09-20 18:32:47,376 - freqtrade - INFO - freqtrade 2024.8
2024-09-20 18:32:47,401 - freqtrade.configuration.load_config - INFO - Using config: user_data/config.json ...
2024-09-20 18:32:47,412 - freqtrade.loggers - INFO - Verbosity set to 0
2024-09-20 18:32:47,412 - freqtrade.configuration.configuration - WARNING - `force_entry_enable` RPC message enabled.
2024-09-20 18:32:47,413 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 3 ...
2024-09-20 18:32:47,413 - freqtrade.configuration.configuration - INFO - Parameter --timerange detected: 20240501-20240505 ...
2024-09-20 18:32:47,824 - freqtrade.configuration.configuration - INFO - Using user-data directory: /freqtrade/user_data ...
2024-09-20 18:32:47,826 - freqtrade.configuration.configuration - INFO - Using data directory: /freqtrade/user_data/data/binance ...
2024-09-20 18:32:47,827 - freqtrade.configuration.configuration - INFO - Parameter --cache=day detected ...
2024-09-20 18:32:47,827 - freqtrade.configuration.configuration - INFO - Filter trades by timerange: 20240501-20240505
2024-09-20 18:32:47,827 - freqtrade.configuration.configuration - INFO - Using freqaimodel class name: XGBoostRegressorQuickAdapterV3
2024-09-20 18:32:47,829 - freqtrade.exchange.check_exchange - INFO - Checking exchange...
2024-09-20 18:32:47,845 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team.
2024-09-20 18:32:47,846 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration.
2024-09-20 18:32:47,846 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2024-09-20 18:32:47,853 - freqtrade.commands.optimize_commands - INFO - Starting freqtrade in Backtesting mode
2024-09-20 18:32:47,855 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2024-09-20 18:32:47,856 - freqtrade.exchange.exchange - INFO - Using CCXT 4.3.88
2024-09-20 18:32:47,856 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-09-20 18:32:47,871 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-09-20 18:32:47,888 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance"
2024-09-20 18:32:56,459 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'...
2024-09-20 18:32:57,149 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/GodStra.py due to 'No module named 'ta''
2024-09-20 18:32:57,167 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/Heracles.py due to 'No module named 'ta''
2024-09-20 18:32:57,218 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/MacheteV8b_Fixed.py due to 'No module named 'finta''
2024-09-20 18:32:57,744 - freqtrade.resolvers.iresolver - INFO - Using resolved strategy QuickAdapterV3 from '/freqtrade/user_data/strategies/QuickAdapterV3.py'...
2024-09-20 18:32:57,746 - freqtrade.strategy.hyper - INFO - Found no parameter file.
2024-09-20 18:32:57,747 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'timeframe' with value in config file: 3m.
2024-09-20 18:32:57,747 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_currency' with value in config file: USDT.
2024-09-20 18:32:57,747 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_amount' with value in config file: unlimited.
2024-09-20 18:32:57,747 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'unfilledtimeout' with value in config file: {'entry': 10, 'exit': 30, 'exit_timeout_count': 0, 'unit': 'minutes'}.
2024-09-20 18:32:57,747 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'max_open_trades' with value in config file: 3.
2024-09-20 18:32:57,747 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using minimal_roi: {'0': 0.03, '5000': -1}
2024-09-20 18:32:57,747 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using timeframe: 3m
2024-09-20 18:32:57,748 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stoploss: -0.04
2024-09-20 18:32:57,748 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop: False
2024-09-20 18:32:57,748 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop_positive_offset: 0.0
2024-09-20 18:32:57,748 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_only_offset_is_reached: False
2024-09-20 18:32:57,748 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using use_custom_stoploss: False
2024-09-20 18:32:57,749 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using process_only_new_candles: True
2024-09-20 18:32:57,750 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_types: {'entry': 'limit', 'exit': 'market', 'emergency_exit': 'market', 'force_exit': 'market', 'force_entry': 'market', 'stoploss': 'market', 'stoploss_on_exchange': False, 'stoploss_on_exchange_interval': 120}
2024-09-20 18:32:57,750 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_time_in_force: {'entry': 'GTC', 'exit': 'GTC'}
2024-09-20 18:32:57,750 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_currency: USDT
2024-09-20 18:32:57,750 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_amount: unlimited
2024-09-20 18:32:57,750 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using protections: [{'method': 'CooldownPeriod', 'stop_duration_candles': 4}, {'method': 'MaxDrawdown', 'lookback_period_candles': 48, 'trade_limit': 20, 'stop_duration_candles': 4, 'max_allowed_drawdown': 0.2}]
2024-09-20 18:32:57,751 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using startup_candle_count: 80
2024-09-20 18:32:57,751 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using unfilledtimeout: {'entry': 10, 'exit': 30, 'exit_timeout_count': 0, 'unit': 'minutes'}
2024-09-20 18:32:57,751 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using use_exit_signal: True
2024-09-20 18:32:57,752 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using exit_profit_only: False
2024-09-20 18:32:57,752 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ignore_roi_if_entry_signal: False
2024-09-20 18:32:57,752 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using exit_profit_offset: 0.0
2024-09-20 18:32:57,753 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using disable_dataframe_checks: False
2024-09-20 18:32:57,753 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ignore_buying_expired_candle_after: 0
2024-09-20 18:32:57,753 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using position_adjustment_enable: False
2024-09-20 18:32:57,753 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using max_entry_position_adjustment: 1
2024-09-20 18:32:57,753 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using max_open_trades: 3
2024-09-20 18:32:57,753 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2024-09-20 18:32:57,792 - freqtrade.resolvers.iresolver - INFO - Using resolved pairlist StaticPairList from '/freqtrade/freqtrade/plugins/pairlist/StaticPairList.py'...
2024-09-20 18:32:57,805 - freqtrade.optimize.backtesting - INFO - Using fee 0.0500% - worst case fee from exchange (lowest tier).
2024-09-20 18:32:57,807 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 3m to 6800
2024-09-20 18:32:57,825 - freqtrade.data.history.history_utils - INFO - Using indicator startup period: 6800 ...
2024-09-20 18:32:58,186 - freqtrade.optimize.backtesting - INFO - Loading data from 2024-04-16 20:00:00 up to 2024-05-05 00:00:00 (18 days).
2024-09-20 18:32:58,285 - freqtrade.optimize.backtesting - INFO - Dataload complete. Calculating indicators
2024-09-20 18:32:58,304 - freqtrade.optimize.backtesting - INFO - Running backtesting for Strategy QuickAdapterV3
2024-09-20 18:32:58,644 - freqtrade.resolvers.iresolver - INFO - Using resolved freqaimodel XGBoostRegressorQuickAdapterV3 from '/freqtrade/user_data/freqaimodels/XGBoostRegressorQuickAdapterV3.py'...
2024-09-20 18:32:58,650 - freqtrade.freqai.freqai_interface - INFO - Backtesting module configured to save all models.
2024-09-20 18:32:58,662 - freqtrade.freqai.data_drawer - INFO - Could not find existing historic_predictions, starting from scratch
2024-09-20 18:32:58,664 - freqtrade.freqai.data_drawer - INFO - Could not find existing metric tracker, starting from scratch
2024-09-20 18:32:58,664 - freqtrade.freqai.freqai_interface - INFO - Set existing queue from trained timestamps. Best approximation queue: {best_queue}
2024-09-20 18:32:58,676 - freqtrade.strategy.hyper - INFO - No params for buy found, using default values.
2024-09-20 18:32:58,677 - freqtrade.strategy.hyper - INFO - No params for sell found, using default values.
2024-09-20 18:32:58,677 - freqtrade.strategy.hyper - INFO - No params for protection found, using default values.
2024-09-20 18:32:58,684 - freqtrade.freqai.freqai_interface - INFO - Training 2 timeranges
2024-09-20 18:32:58,690 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/1 pairs from 2024-04-17 00:00:00 to 2024-05-01 00:00:00, 1/2 trains
2024-09-20 18:32:58,706 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1714521600_prediction.feather
2024-09-20 18:32:58,845 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 5m to 4112
2024-09-20 18:32:58,845 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 5m from 2024-04-16 17:20:00 to 2024-05-05 00:00:00
2024-09-20 18:32:59,902 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 15m to 1424
2024-09-20 18:32:59,903 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 15m from 2024-04-16 04:00:00 to 2024-05-05 00:00:00
2024-09-20 18:33:00,273 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 1h to 416
2024-09-20 18:33:00,274 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 1h from 2024-04-13 16:00:00 to 2024-05-05 00:00:00
2024-09-20 18:33:00,541 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/1 pairs from 2024-04-19 00:00:00 to 2024-05-03 00:00:00, 2/2 trains
2024-09-20 18:33:00,634 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1714694400_prediction.feather
2024-09-20 18:33:00,667 - freqtrade.freqai.freqai_interface - INFO - Applying fit_live_predictions in backtesting
2024-09-20 18:33:00,749 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
  File "/freqtrade/freqtrade/main.py", line 45, in main
    return_code = args["func"](args)
                  ^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/commands/optimize_commands.py", line 60, in start_backtesting
    backtesting.start()
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 1621, in start
    min_date, max_date = self.backtest_one_strategy(strat, data, timerange)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 1531, in backtest_one_strategy
    preprocessed = self.strategy.advise_all_indicators(data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/interface.py", line 1587, in advise_all_indicators
    pair: self.advise_indicators(pair_data.copy(), {"pair": pair}).copy()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/interface.py", line 1645, in advise_indicators
    return self.populate_indicators(dataframe, metadata)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/user_data/strategies/QuickAdapterV3.py", line 239, in populate_indicators
    dataframe = self.freqai.start(dataframe, metadata, self)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/freqai/freqai_interface.py", line 161, in start
    dk = self.start_backtesting(dataframe, metadata, self.dk, strategy)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/freqai/freqai_interface.py", line 387, in start_backtesting
    self.backtesting_fit_live_predictions(dk)
  File "/freqtrade/freqtrade/freqai/freqai_interface.py", line 891, in backtesting_fit_live_predictions
    dk.full_df.at[index, f"{label}_mean"] = self.dk.data["labels_mean"][
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '&s-extrema'

C:\Users\Luca Palese\ft_userdata>docker compose -f docker-compose-ai.yml run --rm freqtrade backtesting --config user_data/config.json --strategy QuickAdapterV3 --freqaimodel XGBoostRegressorQuickAdapterV3 --timerange 20240501-20240504
2024-09-20 18:33:20,036 - freqtrade - INFO - freqtrade 2024.8
2024-09-20 18:33:20,057 - freqtrade.configuration.load_config - INFO - Using config: user_data/config.json ...
2024-09-20 18:33:20,063 - freqtrade.loggers - INFO - Verbosity set to 0
2024-09-20 18:33:20,063 - freqtrade.configuration.configuration - WARNING - `force_entry_enable` RPC message enabled.
2024-09-20 18:33:20,063 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 3 ...
2024-09-20 18:33:20,063 - freqtrade.configuration.configuration - INFO - Parameter --timerange detected: 20240501-20240504 ...
2024-09-20 18:33:20,359 - freqtrade.configuration.configuration - INFO - Using user-data directory: /freqtrade/user_data ...
2024-09-20 18:33:20,362 - freqtrade.configuration.configuration - INFO - Using data directory: /freqtrade/user_data/data/binance ...
2024-09-20 18:33:20,362 - freqtrade.configuration.configuration - INFO - Parameter --cache=day detected ...
2024-09-20 18:33:20,363 - freqtrade.configuration.configuration - INFO - Filter trades by timerange: 20240501-20240504
2024-09-20 18:33:20,363 - freqtrade.configuration.configuration - INFO - Using freqaimodel class name: XGBoostRegressorQuickAdapterV3
2024-09-20 18:33:20,364 - freqtrade.exchange.check_exchange - INFO - Checking exchange...
2024-09-20 18:33:20,381 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team.
2024-09-20 18:33:20,382 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration.
2024-09-20 18:33:20,382 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2024-09-20 18:33:20,388 - freqtrade.commands.optimize_commands - INFO - Starting freqtrade in Backtesting mode
2024-09-20 18:33:20,388 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2024-09-20 18:33:20,389 - freqtrade.exchange.exchange - INFO - Using CCXT 4.3.88
2024-09-20 18:33:20,389 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-09-20 18:33:20,405 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-09-20 18:33:20,424 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance"
2024-09-20 18:33:29,007 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'...
2024-09-20 18:33:29,446 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/GodStra.py due to 'No module named 'ta''
2024-09-20 18:33:29,462 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/Heracles.py due to 'No module named 'ta''
2024-09-20 18:33:29,508 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/MacheteV8b_Fixed.py due to 'No module named 'finta''
2024-09-20 18:33:29,976 - freqtrade.resolvers.iresolver - INFO - Using resolved strategy QuickAdapterV3 from '/freqtrade/user_data/strategies/QuickAdapterV3.py'...
2024-09-20 18:33:29,978 - freqtrade.strategy.hyper - INFO - Found no parameter file.
2024-09-20 18:33:29,979 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'timeframe' with value in config file: 3m.
2024-09-20 18:33:29,979 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_currency' with value in config file: USDT.
2024-09-20 18:33:29,979 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_amount' with value in config file: unlimited.
2024-09-20 18:33:29,979 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'unfilledtimeout' with value in config file: {'entry': 10, 'exit': 30, 'exit_timeout_count': 0, 'unit': 'minutes'}.
2024-09-20 18:33:29,979 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'max_open_trades' with value in config file: 3.
2024-09-20 18:33:29,979 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using minimal_roi: {'0': 0.03, '5000': -1}
2024-09-20 18:33:29,979 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using timeframe: 3m
2024-09-20 18:33:29,980 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stoploss: -0.04
2024-09-20 18:33:29,980 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop: False
2024-09-20 18:33:29,980 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop_positive_offset: 0.0
2024-09-20 18:33:29,980 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_only_offset_is_reached: False
2024-09-20 18:33:29,980 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using use_custom_stoploss: False
2024-09-20 18:33:29,980 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using process_only_new_candles: True
2024-09-20 18:33:29,980 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_types: {'entry': 'limit', 'exit': 'market', 'emergency_exit': 'market', 'force_exit': 'market', 'force_entry': 'market', 'stoploss': 'market', 'stoploss_on_exchange': False, 'stoploss_on_exchange_interval': 120}
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_time_in_force: {'entry': 'GTC', 'exit': 'GTC'}
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_currency: USDT
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_amount: unlimited
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using protections: [{'method': 'CooldownPeriod', 'stop_duration_candles': 4}, {'method': 'MaxDrawdown', 'lookback_period_candles': 48, 'trade_limit': 20, 'stop_duration_candles': 4, 'max_allowed_drawdown': 0.2}]
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using startup_candle_count: 80
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using unfilledtimeout: {'entry': 10, 'exit': 30, 'exit_timeout_count': 0, 'unit': 'minutes'}
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using use_exit_signal: True
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using exit_profit_only: False
2024-09-20 18:33:29,981 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ignore_roi_if_entry_signal: False
2024-09-20 18:33:29,982 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using exit_profit_offset: 0.0
2024-09-20 18:33:29,982 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using disable_dataframe_checks: False
2024-09-20 18:33:29,982 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ignore_buying_expired_candle_after: 0
2024-09-20 18:33:29,982 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using position_adjustment_enable: False
2024-09-20 18:33:29,982 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using max_entry_position_adjustment: 1
2024-09-20 18:33:29,982 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using max_open_trades: 3
2024-09-20 18:33:29,982 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2024-09-20 18:33:30,012 - freqtrade.resolvers.iresolver - INFO - Using resolved pairlist StaticPairList from '/freqtrade/freqtrade/plugins/pairlist/StaticPairList.py'...
2024-09-20 18:33:30,025 - freqtrade.optimize.backtesting - INFO - Using fee 0.0500% - worst case fee from exchange (lowest tier).
2024-09-20 18:33:30,026 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 3m to 6800
2024-09-20 18:33:30,043 - freqtrade.data.history.history_utils - INFO - Using indicator startup period: 6800 ...
2024-09-20 18:33:30,254 - freqtrade.optimize.backtesting - INFO - Loading data from 2024-04-16 20:00:00 up to 2024-05-04 00:00:00 (17 days).
2024-09-20 18:33:30,320 - freqtrade.optimize.backtesting - INFO - Dataload complete. Calculating indicators
2024-09-20 18:33:30,335 - freqtrade.optimize.backtesting - INFO - Running backtesting for Strategy QuickAdapterV3
2024-09-20 18:33:30,455 - freqtrade.resolvers.iresolver - INFO - Using resolved freqaimodel XGBoostRegressorQuickAdapterV3 from '/freqtrade/user_data/freqaimodels/XGBoostRegressorQuickAdapterV3.py'...
2024-09-20 18:33:30,460 - freqtrade.freqai.freqai_interface - INFO - Backtesting module configured to save all models.
2024-09-20 18:33:30,471 - freqtrade.freqai.data_drawer - INFO - Could not find existing historic_predictions, starting from scratch
2024-09-20 18:33:30,473 - freqtrade.freqai.data_drawer - INFO - Could not find existing metric tracker, starting from scratch
2024-09-20 18:33:30,474 - freqtrade.freqai.freqai_interface - INFO - Set existing queue from trained timestamps. Best approximation queue: {best_queue}
2024-09-20 18:33:30,481 - freqtrade.strategy.hyper - INFO - No params for buy found, using default values.
2024-09-20 18:33:30,481 - freqtrade.strategy.hyper - INFO - No params for sell found, using default values.
2024-09-20 18:33:30,482 - freqtrade.strategy.hyper - INFO - No params for protection found, using default values.
2024-09-20 18:33:30,488 - freqtrade.freqai.freqai_interface - INFO - Training 2 timeranges
2024-09-20 18:33:30,491 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/1 pairs from 2024-04-17 00:00:00 to 2024-05-01 00:00:00, 1/2 trains
2024-09-20 18:33:30,505 - freqtrade.freqai.data_kitchen - INFO - Found backtesting prediction file at /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/cb_btc_1714521600_prediction.feather
2024-09-20 18:33:30,592 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 5m to 4112
2024-09-20 18:33:30,592 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 5m from 2024-04-16 17:20:00 to 2024-05-04 00:00:00
2024-09-20 18:33:31,210 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 15m to 1424
2024-09-20 18:33:31,211 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 15m from 2024-04-16 04:00:00 to 2024-05-04 00:00:00
2024-09-20 18:33:31,580 - freqtrade.data.dataprovider - INFO - Increasing startup_candle_count for freqai on 1h to 416
2024-09-20 18:33:31,580 - freqtrade.data.dataprovider - INFO - Loading data for BTC/USDT:USDT 1h from 2024-04-13 16:00:00 to 2024-05-04 00:00:00
2024-09-20 18:33:31,765 - freqtrade.freqai.freqai_interface - INFO - Training BTC/USDT:USDT, 1/1 pairs from 2024-04-19 00:00:00 to 2024-05-03 00:00:00, 2/2 trains
2024-09-20 18:33:31,785 - freqtrade.freqai.data_kitchen - INFO - A new backtesting prediction file is required. (Number of predictions is different from dataframe length or old prediction file version).
2024-09-20 18:33:34,120 - freqtrade.freqai.freqai_interface - INFO - Found model at /freqtrade/user_data/models/quickadapter-xgboost/sub-train-BTC_1714694400/cb_btc_1714694400
2024-09-20 18:33:37,336 - freqtrade.freqai.freqai_interface - INFO - Applying fit_live_predictions in backtesting
2024-09-20 18:34:25,434 - freqtrade.optimize.backtesting - INFO - Backtesting with data from 2024-05-01 00:00:00 up to 2024-05-04 00:00:00 (3 days).
2024-09-20 18:34:25,559 - freqtrade.misc - INFO - dumping json to "/freqtrade/user_data/backtest_results/backtest-result-2024-09-20_18-34-25.meta.json"
2024-09-20 18:34:25,575 - freqtrade.misc - INFO - dumping json to "/freqtrade/user_data/backtest_results/backtest-result-2024-09-20_18-34-25.json"
2024-09-20 18:34:25,592 - freqtrade.misc - INFO - dumping json to "/freqtrade/user_data/backtest_results/.last_result.json"
Result for strategy QuickAdapterV3
                                                BACKTESTING REPORT
┏━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃          Pair ┃ Trades ┃ Avg Profit % ┃ Tot Profit USDT ┃ Tot Profit % ┃ Avg Duration ┃  Win  Draw  Loss  Win% ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ BTC/USDT:USDT │      0 │          0.0 │           0.000 │          0.0 │         0:00 │    0     0     0     0 │
│         TOTAL │      0 │          0.0 │           0.000 │          0.0 │         0:00 │    0     0     0     0 │
└───────────────┴────────┴──────────────┴─────────────────┴──────────────┴──────────────┴────────────────────────┘
                                         LEFT OPEN TRADES REPORT
┏━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃  Pair ┃ Trades ┃ Avg Profit % ┃ Tot Profit USDT ┃ Tot Profit % ┃ Avg Duration ┃  Win  Draw  Loss  Win% ┃
┡━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ TOTAL │      0 │          0.0 │           0.000 │          0.0 │         0:00 │    0     0     0     0 │
└───────┴────────┴──────────────┴─────────────────┴──────────────┴──────────────┴────────────────────────┘
                                                ENTER TAG STATS
┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Enter Tag ┃ Entries ┃ Avg Profit % ┃ Tot Profit USDT ┃ Tot Profit % ┃ Avg Duration ┃  Win  Draw  Loss  Win% ┃
┡━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│     TOTAL │       0 │          0.0 │           0.000 │          0.0 │         0:00 │    0     0     0     0 │
└───────────┴─────────┴──────────────┴─────────────────┴──────────────┴──────────────┴────────────────────────┘
                                               EXIT REASON STATS
┏━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Exit Reason ┃ Exits ┃ Avg Profit % ┃ Tot Profit USDT ┃ Tot Profit % ┃ Avg Duration ┃  Win  Draw  Loss  Win% ┃
┡━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│       TOTAL │     0 │          0.0 │           0.000 │          0.0 │         0:00 │    0     0     0     0 │
└─────────────┴───────┴──────────────┴─────────────────┴──────────────┴──────────────┴────────────────────────┘
                                                      MIXED TAG STATS
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Enter Tag ┃ Exit Reason ┃ Trades ┃ Avg Profit % ┃ Tot Profit USDT ┃ Tot Profit % ┃ Avg Duration ┃  Win  Draw  Loss  Win% ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│     TOTAL │             │      0 │          0.0 │           0.000 │          0.0 │         0:00 │    0     0     0     0 │
└───────────┴─────────────┴────────┴──────────────┴─────────────────┴──────────────┴──────────────┴────────────────────────┘
No trades made. Your starting balance was 1000 USDT, and your stake was unlimited.

Backtested 2024-05-01 00:00:00 -> 2024-05-04 00:00:00 | Max open trades : 1
                                                         STRATEGY SUMMARY
┏━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃       Strategy ┃ Trades ┃ Avg Profit % ┃ Tot Profit USDT ┃ Tot Profit % ┃ Avg Duration ┃  Win  Draw  Loss  Win% ┃      Drawdown ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QuickAdapterV3 │      0 │         0.00 │           0.000 │          0.0 │         0:00 │    0     0     0     0 │ 0 USDT  0.00% │
└────────────────┴────────┴──────────────┴─────────────────┴──────────────┴──────────────┴────────────────────────┴───────────────┘
gachie commented 1 month ago

I was experiencing the same error. Resolved it by deleting the previous backtesting prediction files:

rm /freqtrade/user_data/models/quickadapter-xgboost/backtesting_predictions/*