-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implemented a parameter for skipping errors during model training in the backtest process #10098
Open
xsa-dev
wants to merge
17
commits into
freqtrade:develop
Choose a base branch
from
xsa-dev:Error-Skipping
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+36
−30
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robcaulk
requested changes
Apr 20, 2024
Suggested edit: diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py
index 224b9dbe1..ae17c5940 100644
--- a/freqtrade/freqai/freqai_interface.py
+++ b/freqtrade/freqai/freqai_interface.py
@@ -5,7 +5,7 @@ from abc import ABC, abstractmethod
from collections import deque
from datetime import datetime, timezone
from pathlib import Path
-from typing import Any, Dict, List, Literal, Optional, Tuple, Union
+from typing import Any, Dict, List, Literal, Optional, Tuple
import datasieve.transforms as ds
import numpy as np
@@ -108,7 +108,7 @@ class IFreqaiModel(ABC):
self.data_provider: Optional[DataProvider] = None
self.max_system_threads = max(int(psutil.cpu_count() * 2 - 2), 1)
self.can_short = True # overridden in start() with strategy.can_short
- self.model: Union[Any, None] = None
+ self.model: Any = None
if self.ft_params.get('principal_component_analysis', False) and self.continual_learning:
self.ft_params.update({'principal_component_analysis': False})
logger.warning('User tried to use PCA with continual learning. Deactivating PCA.')
@@ -258,7 +258,7 @@ class IFreqaiModel(ABC):
self.dd.save_metric_tracker_to_disk()
- def _train_model(self, dataframe_train, pair, dk, tr_backtest) -> Union[Any, None]:
+ def _train_model(self, dataframe_train, pair, dk, tr_backtest):
try:
self.tb_logger = get_tb_logger(self.dd.model_type, dk.data_path,
self.activate_tensorboard)
|
xsa-dev
changed the title
implemented a parameter for skipping errors during model training in the backtest process
[WIP] implemented a parameter for skipping errors during model training in the backtest process
Apr 25, 2024
xsa-dev
commented
Apr 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
xsa-dev
changed the title
[WIP] implemented a parameter for skipping errors during model training in the backtest process
implemented a parameter for skipping errors during model training in the backtest process
Apr 25, 2024
close #10145 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In case of any data disruptions related to a coin, currently, a hard exception occurs, interrupting the backtesting and limiting the completion of backtesting for the FreqAI strategy with other coins. To bypass this, it was suggested to use an exception skipping parameter as a warning, during which the exception is ignored during backtesting, allowing the backtesting to continue. In a separate case (with another parameter), resolving this issue may involve additional data preprocessing, which is not included in this feature's development.
Solve the issue: #9671
Quick changelog
warn_exceptions_on_backtest_only
toconfig_examples/config_freqai.example.json
inconfig.freqai
freqtrade/freqai/freqai_interface.py
What's new?
We added an exception skipping parameter to handle data disruptions during backtesting, letting the FreqAI strategy proceed across coins even when exceptions occur, and there's potential for further data preprocessing to tackle such issues later on.