mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Compare commits
42 Commits
3a806ef2d9
...
aba4a17b3e
Author | SHA1 | Date | |
---|---|---|---|
|
aba4a17b3e | ||
|
2fe67edab3 | ||
|
167e43cbef | ||
|
d8cb407c25 | ||
|
9452afe3f7 | ||
|
8dc6d9ce7d | ||
|
bf4b8a318d | ||
|
20f6022050 | ||
|
65e6c737cd | ||
|
6d2572e347 | ||
|
52a35197c7 | ||
|
2b3a41db3e | ||
|
09c1459411 | ||
|
98f18b89da | ||
|
4249db4330 | ||
|
a7f46500ed | ||
|
c73fa2b0eb | ||
|
db4c4b971a | ||
|
e9ccc98ada | ||
|
11d6ec33b3 | ||
|
c3b6f4ca85 | ||
|
d37405a307 | ||
|
d7a9841328 | ||
|
cf3af42477 | ||
|
ad8e6e7d67 | ||
|
d7b86ee436 | ||
|
7a04f876c3 | ||
|
0ef7e9db13 | ||
|
ac5c22d0bc | ||
|
98ef62cb46 | ||
|
45c8161448 | ||
|
62c64e2467 | ||
|
fce4536ef2 | ||
|
0008a87232 | ||
|
116bcc2bce | ||
|
778add6d92 | ||
|
5782124df9 | ||
|
c5e68afb2c | ||
|
49487afc86 | ||
|
4b9f0c2fc2 | ||
|
a72587576e | ||
|
c537c43dd0 |
|
@ -16,7 +16,7 @@ repos:
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- types-cachetools==5.5.0.20240820
|
- types-cachetools==5.5.0.20240820
|
||||||
- types-filelock==3.2.7
|
- types-filelock==3.2.7
|
||||||
- types-requests==2.32.0.20240907
|
- types-requests==2.32.0.20240914
|
||||||
- types-tabulate==0.9.0.20240106
|
- types-tabulate==0.9.0.20240106
|
||||||
- types-python-dateutil==2.9.0.20240906
|
- types-python-dateutil==2.9.0.20240906
|
||||||
- SQLAlchemy==2.0.34
|
- SQLAlchemy==2.0.34
|
||||||
|
|
|
@ -3594,7 +3594,7 @@ class Exchange:
|
||||||
Wherein, "+" or "-" depends on whether the contract goes long or short:
|
Wherein, "+" or "-" depends on whether the contract goes long or short:
|
||||||
"-" for long, and "+" for short.
|
"-" for long, and "+" for short.
|
||||||
|
|
||||||
okex: https://www.okex.com/support/hc/en-us/articles/
|
okex: https://www.okx.com/support/hc/en-us/articles/
|
||||||
360053909592-VI-Introduction-to-the-isolated-mode-of-Single-Multi-currency-Portfolio-margin
|
360053909592-VI-Introduction-to-the-isolated-mode-of-Single-Multi-currency-Portfolio-margin
|
||||||
|
|
||||||
:param pair: Pair to calculate liquidation price for
|
:param pair: Pair to calculate liquidation price for
|
||||||
|
|
|
@ -70,7 +70,7 @@ class IFreqaiModel(ABC):
|
||||||
self.retrain = False
|
self.retrain = False
|
||||||
self.first = True
|
self.first = True
|
||||||
self.set_full_path()
|
self.set_full_path()
|
||||||
self.save_backtest_models: bool = self.freqai_info.get("save_backtest_models", True)
|
self.save_backtest_models: bool = self.freqai_info.get("save_backtest_models", False)
|
||||||
if self.save_backtest_models:
|
if self.save_backtest_models:
|
||||||
logger.info("Backtesting module configured to save all models.")
|
logger.info("Backtesting module configured to save all models.")
|
||||||
|
|
||||||
|
@ -258,6 +258,23 @@ class IFreqaiModel(ABC):
|
||||||
if self.freqai_info.get("write_metrics_to_disk", False):
|
if self.freqai_info.get("write_metrics_to_disk", False):
|
||||||
self.dd.save_metric_tracker_to_disk()
|
self.dd.save_metric_tracker_to_disk()
|
||||||
|
|
||||||
|
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
|
||||||
|
)
|
||||||
|
model = self.train(dataframe_train, pair, dk)
|
||||||
|
self.tb_logger.close()
|
||||||
|
return model
|
||||||
|
except Exception as msg:
|
||||||
|
logger.warning(
|
||||||
|
f"Training {pair} raised exception {msg.__class__.__name__}. "
|
||||||
|
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}."
|
||||||
|
f"Message: {msg}, skipping.",
|
||||||
|
exc_info=True,
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
def start_backtesting(
|
def start_backtesting(
|
||||||
self, dataframe: DataFrame, metadata: dict, dk: FreqaiDataKitchen, strategy: IStrategy
|
self, dataframe: DataFrame, metadata: dict, dk: FreqaiDataKitchen, strategy: IStrategy
|
||||||
) -> FreqaiDataKitchen:
|
) -> FreqaiDataKitchen:
|
||||||
|
@ -352,37 +369,26 @@ class IFreqaiModel(ABC):
|
||||||
if not self.model_exists(dk):
|
if not self.model_exists(dk):
|
||||||
dk.find_features(dataframe_train)
|
dk.find_features(dataframe_train)
|
||||||
dk.find_labels(dataframe_train)
|
dk.find_labels(dataframe_train)
|
||||||
|
self.model = self._train_model(dataframe_train, pair, dk, tr_backtest)
|
||||||
|
|
||||||
try:
|
if self.model:
|
||||||
self.tb_logger = get_tb_logger(
|
self.dd.pair_dict[pair]["trained_timestamp"] = int(tr_train.stopts)
|
||||||
self.dd.model_type, dk.data_path, self.activate_tensorboard
|
if self.plot_features and self.model is not None:
|
||||||
)
|
plot_feature_importance(self.model, pair, dk, self.plot_features)
|
||||||
self.model = self.train(dataframe_train, pair, dk)
|
if self.save_backtest_models and self.model is not None:
|
||||||
self.tb_logger.close()
|
logger.info("Saving backtest model to disk.")
|
||||||
except Exception as msg:
|
self.dd.save_data(self.model, pair, dk)
|
||||||
logger.warning(
|
else:
|
||||||
f"Training {pair} raised exception {msg.__class__.__name__}. "
|
logger.info("Saving metadata to disk.")
|
||||||
f"Message: {msg}, skipping.",
|
self.dd.save_metadata(dk)
|
||||||
exc_info=True,
|
|
||||||
)
|
|
||||||
self.model = None
|
|
||||||
|
|
||||||
self.dd.pair_dict[pair]["trained_timestamp"] = int(tr_train.stopts)
|
|
||||||
if self.plot_features and self.model is not None:
|
|
||||||
plot_feature_importance(self.model, pair, dk, self.plot_features)
|
|
||||||
if self.save_backtest_models and self.model is not None:
|
|
||||||
logger.info("Saving backtest model to disk.")
|
|
||||||
self.dd.save_data(self.model, pair, dk)
|
|
||||||
else:
|
|
||||||
logger.info("Saving metadata to disk.")
|
|
||||||
self.dd.save_metadata(dk)
|
|
||||||
else:
|
else:
|
||||||
self.model = self.dd.load_data(pair, dk)
|
self.model = self.dd.load_data(pair, dk)
|
||||||
|
|
||||||
pred_df, do_preds = self.predict(dataframe_backtest, dk)
|
if self.model and len(dataframe_backtest):
|
||||||
append_df = dk.get_predictions_to_append(pred_df, do_preds, dataframe_backtest)
|
pred_df, do_preds = self.predict(dataframe_backtest, dk)
|
||||||
dk.append_predictions(append_df)
|
append_df = dk.get_predictions_to_append(pred_df, do_preds, dataframe_backtest)
|
||||||
dk.save_backtesting_prediction(append_df)
|
dk.append_predictions(append_df)
|
||||||
|
dk.save_backtesting_prediction(append_df)
|
||||||
|
|
||||||
self.backtesting_fit_live_predictions(dk)
|
self.backtesting_fit_live_predictions(dk)
|
||||||
dk.fill_predictions(dataframe)
|
dk.fill_predictions(dataframe)
|
||||||
|
@ -829,7 +835,7 @@ class IFreqaiModel(ABC):
|
||||||
:param pair: current pair
|
:param pair: current pair
|
||||||
:return: if the data exists or not
|
:return: if the data exists or not
|
||||||
"""
|
"""
|
||||||
if self.config.get("freqai_backtest_live_models", False) and len_dataframe_backtest == 0:
|
if len_dataframe_backtest == 0:
|
||||||
logger.info(
|
logger.info(
|
||||||
f"No data found for pair {pair} from "
|
f"No data found for pair {pair} from "
|
||||||
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}. "
|
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}. "
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
-r docs/requirements-docs.txt
|
-r docs/requirements-docs.txt
|
||||||
|
|
||||||
coveralls==4.0.1
|
coveralls==4.0.1
|
||||||
ruff==0.6.4
|
ruff==0.6.5
|
||||||
mypy==1.11.2
|
mypy==1.11.2
|
||||||
pre-commit==3.8.0
|
pre-commit==3.8.0
|
||||||
pytest==8.3.2
|
pytest==8.3.3
|
||||||
pytest-asyncio==0.24.0
|
pytest-asyncio==0.24.0
|
||||||
pytest-cov==5.0.0
|
pytest-cov==5.0.0
|
||||||
pytest-mock==3.14.0
|
pytest-mock==3.14.0
|
||||||
|
@ -27,6 +27,6 @@ nbconvert==7.16.4
|
||||||
# mypy types
|
# mypy types
|
||||||
types-cachetools==5.5.0.20240820
|
types-cachetools==5.5.0.20240820
|
||||||
types-filelock==3.2.7
|
types-filelock==3.2.7
|
||||||
types-requests==2.32.0.20240907
|
types-requests==2.32.0.20240914
|
||||||
types-tabulate==0.9.0.20240106
|
types-tabulate==0.9.0.20240106
|
||||||
types-python-dateutil==2.9.0.20240906
|
types-python-dateutil==2.9.0.20240906
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
-r requirements-plot.txt
|
-r requirements-plot.txt
|
||||||
|
|
||||||
# Required for freqai
|
# Required for freqai
|
||||||
scikit-learn==1.5.1
|
scikit-learn==1.5.2
|
||||||
joblib==1.4.2
|
joblib==1.4.2
|
||||||
catboost==1.2.7; 'arm' not in platform_machine
|
catboost==1.2.7; 'arm' not in platform_machine
|
||||||
# Pin Matplotlib - it's depended on by catboost
|
# Pin Matplotlib - it's depended on by catboost
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
# Required for hyperopt
|
# Required for hyperopt
|
||||||
scipy==1.14.1; python_version >= "3.10"
|
scipy==1.14.1; python_version >= "3.10"
|
||||||
scipy==1.13.1; python_version < "3.10"
|
scipy==1.13.1; python_version < "3.10"
|
||||||
scikit-learn==1.5.1
|
scikit-learn==1.5.2
|
||||||
ft-scikit-optimize==0.9.2
|
ft-scikit-optimize==0.9.2
|
||||||
filelock==3.16.0
|
filelock==3.16.0
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Include all requirements to run the bot.
|
# Include all requirements to run the bot.
|
||||||
-r requirements.txt
|
-r requirements.txt
|
||||||
|
|
||||||
plotly==5.24.0
|
plotly==5.24.1
|
||||||
|
|
|
@ -4,7 +4,7 @@ bottleneck==1.4.0
|
||||||
numexpr==2.10.1
|
numexpr==2.10.1
|
||||||
pandas-ta==0.3.14b
|
pandas-ta==0.3.14b
|
||||||
|
|
||||||
ccxt==4.3.98
|
ccxt==4.4.3
|
||||||
cryptography==42.0.8; platform_machine == 'armv7l'
|
cryptography==42.0.8; platform_machine == 'armv7l'
|
||||||
cryptography==43.0.1; platform_machine != 'armv7l'
|
cryptography==43.0.1; platform_machine != 'armv7l'
|
||||||
aiohttp==3.10.5
|
aiohttp==3.10.5
|
||||||
|
@ -15,7 +15,7 @@ httpx>=0.24.1
|
||||||
humanize==4.10.0
|
humanize==4.10.0
|
||||||
cachetools==5.5.0
|
cachetools==5.5.0
|
||||||
requests==2.32.3
|
requests==2.32.3
|
||||||
urllib3==2.2.2
|
urllib3==2.2.3
|
||||||
jsonschema==4.23.0
|
jsonschema==4.23.0
|
||||||
TA-Lib==0.4.32
|
TA-Lib==0.4.32
|
||||||
technical==1.4.4
|
technical==1.4.4
|
||||||
|
@ -26,7 +26,7 @@ jinja2==3.1.4
|
||||||
tables==3.9.1; python_version < "3.10"
|
tables==3.9.1; python_version < "3.10"
|
||||||
tables==3.10.1; python_version >= "3.10"
|
tables==3.10.1; python_version >= "3.10"
|
||||||
joblib==1.4.2
|
joblib==1.4.2
|
||||||
rich==13.8.0
|
rich==13.8.1
|
||||||
pyarrow==17.0.0; platform_machine != 'armv7l'
|
pyarrow==17.0.0; platform_machine != 'armv7l'
|
||||||
|
|
||||||
# find first, C search in arrays
|
# find first, C search in arrays
|
||||||
|
@ -41,8 +41,8 @@ orjson==3.10.7
|
||||||
sdnotify==0.3.2
|
sdnotify==0.3.2
|
||||||
|
|
||||||
# API Server
|
# API Server
|
||||||
fastapi==0.114.0
|
fastapi==0.114.2
|
||||||
pydantic==2.9.0
|
pydantic==2.9.1
|
||||||
uvicorn==0.30.6
|
uvicorn==0.30.6
|
||||||
pyjwt==2.9.0
|
pyjwt==2.9.0
|
||||||
aiofiles==24.1.0
|
aiofiles==24.1.0
|
||||||
|
@ -53,7 +53,7 @@ questionary==2.0.1
|
||||||
prompt-toolkit==3.0.36
|
prompt-toolkit==3.0.36
|
||||||
# Extensions to datetime library
|
# Extensions to datetime library
|
||||||
python-dateutil==2.9.0.post0
|
python-dateutil==2.9.0.post0
|
||||||
pytz==2024.1
|
pytz==2024.2
|
||||||
|
|
||||||
#Futures
|
#Futures
|
||||||
schedule==1.2.2
|
schedule==1.2.2
|
||||||
|
|
Loading…
Reference in New Issue
Block a user