Compare commits

...

42 Commits

Author SHA1 Message Date
Alxy Savin
aba4a17b3e
Merge d7b86ee436 into 2fe67edab3 2024-09-17 01:58:40 +02:00
Matthias
2fe67edab3 chore: update link to okx liquidation formula
Some checks failed
Build Documentation / Deploy Docs through mike (push) Waiting to run
Pre-commit auto-update / auto-update (push) Has been cancelled
2024-09-16 19:05:00 +02:00
Matthias
167e43cbef
Merge pull request #10655 from freqtrade/dependabot/pip/develop/types-dda07fe7e8
Some checks are pending
Build Documentation / Deploy Docs through mike (push) Waiting to run
chore(deps-dev): bump types-requests from 2.32.0.20240907 to 2.32.0.20240914 in the types group
2024-09-16 11:12:07 +02:00
Matthias
d8cb407c25
Merge pull request #10666 from freqtrade/dependabot/pip/develop/pydantic-2.9.1
chore(deps): bump pydantic from 2.9.0 to 2.9.1
2024-09-16 10:56:51 +02:00
Matthias
9452afe3f7
Merge pull request #10660 from freqtrade/dependabot/pip/develop/ruff-0.6.5
chore(deps-dev): bump ruff from 0.6.4 to 0.6.5
2024-09-16 10:21:12 +02:00
Matthias
8dc6d9ce7d
Merge pull request #10665 from freqtrade/dependabot/pip/develop/rich-13.8.1
chore(deps): bump rich from 13.8.0 to 13.8.1
2024-09-16 09:45:01 +02:00
Matthias
bf4b8a318d
Merge pull request #10661 from freqtrade/dependabot/pip/develop/scikit-learn-1.5.2
chore(deps): bump scikit-learn from 1.5.1 to 1.5.2
2024-09-16 09:44:31 +02:00
Matthias
20f6022050
Merge pull request #10663 from freqtrade/dependabot/pip/develop/ccxt-4.4.3
chore(deps): bump ccxt from 4.3.98 to 4.4.3
2024-09-16 09:33:16 +02:00
dependabot[bot]
65e6c737cd
chore(deps): bump pydantic from 2.9.0 to 2.9.1
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 07:07:06 +00:00
Matthias
6d2572e347
Merge pull request #10662 from freqtrade/dependabot/pip/develop/fastapi-0.114.2
Some checks are pending
Build Documentation / Deploy Docs through mike (push) Waiting to run
chore(deps): bump fastapi from 0.114.0 to 0.114.2
2024-09-16 09:06:12 +02:00
Matthias
52a35197c7
Merge pull request #10659 from freqtrade/dependabot/pip/develop/pytz-2024.2
chore(deps): bump pytz from 2024.1 to 2024.2
2024-09-16 08:33:08 +02:00
Matthias
2b3a41db3e
Merge pull request #10658 from freqtrade/dependabot/pip/develop/urllib3-2.2.3
chore(deps): bump urllib3 from 2.2.2 to 2.2.3
2024-09-16 08:32:52 +02:00
dependabot[bot]
09c1459411
chore(deps-dev): bump ruff from 0.6.4 to 0.6.5
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.4 to 0.6.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.4...0.6.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 06:17:40 +00:00
Matthias
98f18b89da
Merge pull request #10657 from freqtrade/dependabot/pip/develop/plotly-5.24.1
chore(deps): bump plotly from 5.24.0 to 5.24.1
2024-09-16 08:16:56 +02:00
Matthias
4249db4330
Merge pull request #10656 from freqtrade/dependabot/pip/develop/pytest-baa91b6655
chore(deps-dev): bump pytest from 8.3.2 to 8.3.3 in the pytest group
2024-09-16 08:16:43 +02:00
Matthias
a7f46500ed
chore: bump types-requests in pre-commit 2024-09-16 06:38:45 +02:00
dependabot[bot]
c73fa2b0eb
chore(deps): bump rich from 13.8.0 to 13.8.1
Bumps [rich](https://github.com/Textualize/rich) from 13.8.0 to 13.8.1.
- [Release notes](https://github.com/Textualize/rich/releases)
- [Changelog](https://github.com/Textualize/rich/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Textualize/rich/compare/v13.8.0...v13.8.1)

---
updated-dependencies:
- dependency-name: rich
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:18:09 +00:00
dependabot[bot]
db4c4b971a
chore(deps): bump ccxt from 4.3.98 to 4.4.3
Bumps [ccxt](https://github.com/ccxt/ccxt) from 4.3.98 to 4.4.3.
- [Release notes](https://github.com/ccxt/ccxt/releases)
- [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ccxt/ccxt/compare/4.3.98...4.4.3)

---
updated-dependencies:
- dependency-name: ccxt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:58 +00:00
dependabot[bot]
e9ccc98ada
chore(deps): bump fastapi from 0.114.0 to 0.114.2
Bumps [fastapi](https://github.com/fastapi/fastapi) from 0.114.0 to 0.114.2.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.114.0...0.114.2)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:46 +00:00
dependabot[bot]
11d6ec33b3
chore(deps): bump scikit-learn from 1.5.1 to 1.5.2
Bumps [scikit-learn](https://github.com/scikit-learn/scikit-learn) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](https://github.com/scikit-learn/scikit-learn/compare/1.5.1...1.5.2)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:39 +00:00
dependabot[bot]
c3b6f4ca85
chore(deps): bump pytz from 2024.1 to 2024.2
Bumps [pytz](https://github.com/stub42/pytz) from 2024.1 to 2024.2.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2024.1...release_2024.2)

---
updated-dependencies:
- dependency-name: pytz
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:21 +00:00
dependabot[bot]
d37405a307
chore(deps): bump urllib3 from 2.2.2 to 2.2.3
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.2...2.2.3)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:05 +00:00
dependabot[bot]
d7a9841328
chore(deps): bump plotly from 5.24.0 to 5.24.1
Bumps [plotly](https://github.com/plotly/plotly.py) from 5.24.0 to 5.24.1.
- [Release notes](https://github.com/plotly/plotly.py/releases)
- [Changelog](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md)
- [Commits](https://github.com/plotly/plotly.py/compare/v5.24.0...v5.24.1)

---
updated-dependencies:
- dependency-name: plotly
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:01 +00:00
dependabot[bot]
cf3af42477
chore(deps-dev): bump pytest from 8.3.2 to 8.3.3 in the pytest group
Bumps the pytest group with 1 update: [pytest](https://github.com/pytest-dev/pytest).


Updates `pytest` from 8.3.2 to 8.3.3
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: pytest
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:16:39 +00:00
dependabot[bot]
ad8e6e7d67
chore(deps-dev): bump types-requests in the types group
Bumps the types group with 1 update: [types-requests](https://github.com/python/typeshed).


Updates `types-requests` from 2.32.0.20240907 to 2.32.0.20240914
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-requests
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:15:58 +00:00
Aleksey Savin
d7b86ee436 ruff reformatted 2024-06-01 17:16:10 +03:00
Aleksey Savin
7a04f876c3 Merge branch 'develop' into Error-Skipping 2024-06-01 17:01:47 +03:00
Aleksey Savin
0ef7e9db13
Merge branch 'develop' into Error-Skipping 2024-06-01 00:33:53 +03:00
Aleksey Savin
ac5c22d0bc ... 2024-06-01 00:32:05 +03:00
Aleksey Savin
98ef62cb46
Delete makefile 2024-06-01 00:26:05 +03:00
Aleksey Savin
45c8161448 for local testing 2024-05-31 21:07:43 +00:00
Aleksey Savin
62c64e2467 I tweaked the ensure_data_exists function so that it always works without parameter 2024-04-28 19:59:47 +00:00
Matthias
fce4536ef2 Merge branch 'develop' into Error-Skipping 2024-04-25 21:12:20 +02:00
Aleksey Savin
0008a87232 Merge remote-tracking branch 'upstream/develop' into Error-Skipping 2024-04-25 18:38:58 +03:00
Aleksey Savin
116bcc2bce check for backtesting dataframe 2024-04-25 14:35:02 +00:00
Aleksey Savin
778add6d92 default save_backtest_models sync with docs 2024-04-25 08:18:52 +00:00
Aleksey Savin
5782124df9 flake8 2024-04-23 23:18:32 +00:00
Aleksey Savin
c5e68afb2c remove union 2024-04-23 23:11:08 +00:00
Aleksey Savin
49487afc86 fix for merge 2024-04-23 22:42:04 +00:00
Aleksey Savin
4b9f0c2fc2 remove new feature flag 2024-04-23 18:48:01 +00:00
Aleksey Savin
a72587576e check and fix formating code with ruff 2024-04-18 09:27:30 +00:00
Aleksey Savin
c537c43dd0 only warn on exceptions in backtest for freqai interface 2024-04-18 09:09:01 +00:00
8 changed files with 49 additions and 43 deletions

View File

@ -16,7 +16,7 @@ repos:
additional_dependencies:
- types-cachetools==5.5.0.20240820
- types-filelock==3.2.7
- types-requests==2.32.0.20240907
- types-requests==2.32.0.20240914
- types-tabulate==0.9.0.20240106
- types-python-dateutil==2.9.0.20240906
- SQLAlchemy==2.0.34

View File

@ -3594,7 +3594,7 @@ class Exchange:
Wherein, "+" or "-" depends on whether the contract goes long or 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
:param pair: Pair to calculate liquidation price for

View File

@ -70,7 +70,7 @@ class IFreqaiModel(ABC):
self.retrain = False
self.first = True
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:
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):
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(
self, dataframe: DataFrame, metadata: dict, dk: FreqaiDataKitchen, strategy: IStrategy
) -> FreqaiDataKitchen:
@ -352,37 +369,26 @@ class IFreqaiModel(ABC):
if not self.model_exists(dk):
dk.find_features(dataframe_train)
dk.find_labels(dataframe_train)
self.model = self._train_model(dataframe_train, pair, dk, tr_backtest)
try:
self.tb_logger = get_tb_logger(
self.dd.model_type, dk.data_path, self.activate_tensorboard
)
self.model = self.train(dataframe_train, pair, dk)
self.tb_logger.close()
except Exception as msg:
logger.warning(
f"Training {pair} raised exception {msg.__class__.__name__}. "
f"Message: {msg}, skipping.",
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)
if self.model:
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:
self.model = self.dd.load_data(pair, dk)
pred_df, do_preds = self.predict(dataframe_backtest, dk)
append_df = dk.get_predictions_to_append(pred_df, do_preds, dataframe_backtest)
dk.append_predictions(append_df)
dk.save_backtesting_prediction(append_df)
if self.model and len(dataframe_backtest):
pred_df, do_preds = self.predict(dataframe_backtest, dk)
append_df = dk.get_predictions_to_append(pred_df, do_preds, dataframe_backtest)
dk.append_predictions(append_df)
dk.save_backtesting_prediction(append_df)
self.backtesting_fit_live_predictions(dk)
dk.fill_predictions(dataframe)
@ -829,7 +835,7 @@ class IFreqaiModel(ABC):
:param pair: current pair
: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(
f"No data found for pair {pair} from "
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}. "

View File

@ -7,10 +7,10 @@
-r docs/requirements-docs.txt
coveralls==4.0.1
ruff==0.6.4
ruff==0.6.5
mypy==1.11.2
pre-commit==3.8.0
pytest==8.3.2
pytest==8.3.3
pytest-asyncio==0.24.0
pytest-cov==5.0.0
pytest-mock==3.14.0
@ -27,6 +27,6 @@ nbconvert==7.16.4
# mypy types
types-cachetools==5.5.0.20240820
types-filelock==3.2.7
types-requests==2.32.0.20240907
types-requests==2.32.0.20240914
types-tabulate==0.9.0.20240106
types-python-dateutil==2.9.0.20240906

View File

@ -3,7 +3,7 @@
-r requirements-plot.txt
# Required for freqai
scikit-learn==1.5.1
scikit-learn==1.5.2
joblib==1.4.2
catboost==1.2.7; 'arm' not in platform_machine
# Pin Matplotlib - it's depended on by catboost

View File

@ -4,6 +4,6 @@
# Required for hyperopt
scipy==1.14.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
filelock==3.16.0

View File

@ -1,4 +1,4 @@
# Include all requirements to run the bot.
-r requirements.txt
plotly==5.24.0
plotly==5.24.1

View File

@ -4,7 +4,7 @@ bottleneck==1.4.0
numexpr==2.10.1
pandas-ta==0.3.14b
ccxt==4.3.98
ccxt==4.4.3
cryptography==42.0.8; platform_machine == 'armv7l'
cryptography==43.0.1; platform_machine != 'armv7l'
aiohttp==3.10.5
@ -15,7 +15,7 @@ httpx>=0.24.1
humanize==4.10.0
cachetools==5.5.0
requests==2.32.3
urllib3==2.2.2
urllib3==2.2.3
jsonschema==4.23.0
TA-Lib==0.4.32
technical==1.4.4
@ -26,7 +26,7 @@ jinja2==3.1.4
tables==3.9.1; python_version < "3.10"
tables==3.10.1; python_version >= "3.10"
joblib==1.4.2
rich==13.8.0
rich==13.8.1
pyarrow==17.0.0; platform_machine != 'armv7l'
# find first, C search in arrays
@ -41,8 +41,8 @@ orjson==3.10.7
sdnotify==0.3.2
# API Server
fastapi==0.114.0
pydantic==2.9.0
fastapi==0.114.2
pydantic==2.9.1
uvicorn==0.30.6
pyjwt==2.9.0
aiofiles==24.1.0
@ -53,7 +53,7 @@ questionary==2.0.1
prompt-toolkit==3.0.36
# Extensions to datetime library
python-dateutil==2.9.0.post0
pytz==2024.1
pytz==2024.2
#Futures
schedule==1.2.2