mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-15 20:31:43 +00:00
Merge remote-tracking branch 'origin/develop' into dependabot/pip/develop/ccxt-4.4.85
This commit is contained in:
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
|
||||
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
|
||||
with:
|
||||
activate-environment: true
|
||||
enable-cache: true
|
||||
@@ -171,7 +171,7 @@ jobs:
|
||||
check-latest: true
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
|
||||
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
|
||||
with:
|
||||
activate-environment: true
|
||||
enable-cache: true
|
||||
@@ -298,7 +298,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
|
||||
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
|
||||
with:
|
||||
activate-environment: true
|
||||
enable-cache: true
|
||||
@@ -446,7 +446,7 @@ jobs:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
|
||||
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
|
||||
with:
|
||||
activate-environment: true
|
||||
enable-cache: true
|
||||
|
||||
@@ -26,7 +26,7 @@ repos:
|
||||
- id: mypy
|
||||
exclude: build_helpers
|
||||
additional_dependencies:
|
||||
- types-cachetools==5.5.0.20240820
|
||||
- types-cachetools==6.0.0.20250525
|
||||
- types-filelock==3.2.7
|
||||
- types-requests==2.32.0.20250515
|
||||
- types-tabulate==0.9.0.20241207
|
||||
@@ -43,7 +43,7 @@ repos:
|
||||
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: 'v0.11.10'
|
||||
rev: 'v0.11.11'
|
||||
hooks:
|
||||
- id: ruff
|
||||
- id: ruff-format
|
||||
@@ -82,6 +82,6 @@ repos:
|
||||
|
||||
# Ensure github actions remain safe
|
||||
- repo: https://github.com/woodruffw/zizmor-pre-commit
|
||||
rev: v1.7.0
|
||||
rev: v1.8.0
|
||||
hooks:
|
||||
- id: zizmor
|
||||
|
||||
18
docs/includes/strategy-exit-comparisons.md
Normal file
18
docs/includes/strategy-exit-comparisons.md
Normal file
@@ -0,0 +1,18 @@
|
||||
## Exit logic comparisons
|
||||
|
||||
Freqtrade allows your strategy to implement different exit logic using signal-based or callback-based functions.
|
||||
This section aims to compare each different function, helping you to choose the one that best fits your needs.
|
||||
|
||||
* **`populate_exit_trend()`** - Vectorized signal-based exit logic using indicators in the main dataframe
|
||||
✅ **Use** to define exit signals based on indicators or other data that can be calculated in a vectorized manner.
|
||||
🚫 **Don't use** to customize exit conditions for each individual trade, or if trade data is necessary to make an exit decision.
|
||||
* **`custom_exit()`** - Custom exit logic that will fully exit a trade immediately, called for every open trade at every bot loop iteration until a trade is closed.
|
||||
✅ **Use** to specify exit conditions for each individual trade (including any additional adjusted orders using `adjust_trade_position()`), or if trade data is necessary to make an exit decision, e.g. using profit data to exit.
|
||||
🚫 **Don't use** when you want to exit using vectorised indicator-based data (use a `populate_exit_trend()` signal instead), or as a proxy for `custom_stoploss()`, and be aware that rate-based exits in backtesting can be inaccurate.
|
||||
* **`custom_stoploss()`** - Custom trailing stoploss, called for every open trade every iteration until a trade is closed. The value returned here is also used for [stoploss on exchange](stoploss.md#stop-loss-on-exchangefreqtrade).
|
||||
✅ **Use** to customize the stoploss logic to set a dynamic stoploss based on trade data or other conditions.
|
||||
🚫 **Don't use** to exit a trade immediately based on a specific condition. Use `custom_exit()` for that purpose.
|
||||
* **`custom_roi()`** - Custom ROI, called for every open trade every iteration until a trade is closed.
|
||||
✅ **Use** to specify a minimum ROI threshold ("take-profit") to exit a trade at this ROI level at some point within the trade duration, based on profit or other conditions.
|
||||
🚫 **Don't use** to exit a trade immediately based on a specific condition. Use `custom_exit()`.
|
||||
🚫 **Don't use** for static ROI. Use `minimal_roi`.
|
||||
@@ -27,6 +27,9 @@ Currently available callbacks:
|
||||
|
||||
--8<-- "includes/strategy-imports.md"
|
||||
|
||||
--8<-- "includes/strategy-exit-comparisons.md"
|
||||
|
||||
|
||||
## Bot start
|
||||
|
||||
A simple callback which is called once when the strategy is loaded.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2450,7 +2450,15 @@ class Exchange:
|
||||
self._exchange_ws.klines_last_refresh.get((pair, timeframe, candle_type), 0)
|
||||
)
|
||||
|
||||
if candles and candles[-1][0] >= prev_candle_ts and last_refresh_time >= half_candle:
|
||||
if (
|
||||
candles
|
||||
and (
|
||||
(len(candles) > 1 and candles[-1][0] >= prev_candle_ts)
|
||||
# Edgecase on reconnect, where 1 candle is available but it's the current one
|
||||
or (len(candles) == 1 and candles[-1][0] < candle_ts)
|
||||
)
|
||||
and last_refresh_time >= half_candle
|
||||
):
|
||||
# Usable result, candle contains the previous candle.
|
||||
# Also, we check if the last refresh time is no more than half the candle ago.
|
||||
logger.debug(f"reuse watch result for {pair}, {timeframe}, {last_refresh_time}")
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-r docs/requirements-docs.txt
|
||||
|
||||
coveralls==4.0.1
|
||||
ruff==0.11.10
|
||||
ruff==0.11.11
|
||||
mypy==1.15.0
|
||||
pre-commit==4.2.0
|
||||
pytest==8.3.5
|
||||
@@ -25,7 +25,7 @@ time-machine==2.16.0
|
||||
nbconvert==7.16.6
|
||||
|
||||
# mypy types
|
||||
types-cachetools==5.5.0.20240820
|
||||
types-cachetools==6.0.0.20250525
|
||||
types-filelock==3.2.7
|
||||
types-requests==2.32.0.20250515
|
||||
types-tabulate==0.9.0.20241207
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
# Required for freqai
|
||||
scikit-learn==1.6.1
|
||||
joblib==1.5.0
|
||||
joblib==1.5.1
|
||||
catboost==1.2.8; 'arm' not in platform_machine
|
||||
lightgbm==4.6.0
|
||||
xgboost==3.0.1
|
||||
xgboost==3.0.2
|
||||
tensorboard==2.19.0
|
||||
datasieve==0.1.9
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Include all requirements to run the bot.
|
||||
-r requirements.txt
|
||||
|
||||
plotly==6.0.1
|
||||
plotly==6.1.1
|
||||
|
||||
@@ -5,14 +5,14 @@ numexpr==2.10.2
|
||||
pandas-ta==0.3.14b
|
||||
|
||||
ccxt==4.4.85
|
||||
cryptography==45.0.2
|
||||
cryptography==45.0.3
|
||||
aiohttp==3.11.18
|
||||
SQLAlchemy==2.0.41
|
||||
python-telegram-bot==22.1
|
||||
# can't be hard-pinned due to telegram-bot pinning httpx with ~
|
||||
httpx>=0.24.1
|
||||
humanize==4.12.3
|
||||
cachetools==5.5.2
|
||||
cachetools==6.0.0
|
||||
requests==2.32.3
|
||||
urllib3==2.4.0
|
||||
certifi==2025.4.26
|
||||
@@ -22,7 +22,7 @@ technical==1.5.0
|
||||
tabulate==0.9.0
|
||||
pycoingecko==3.2.0
|
||||
jinja2==3.1.6
|
||||
joblib==1.5.0
|
||||
joblib==1.5.1
|
||||
rich==14.0.0
|
||||
pyarrow==20.0.0; platform_machine != 'armv7l'
|
||||
|
||||
@@ -39,7 +39,7 @@ sdnotify==0.3.2
|
||||
|
||||
# API Server
|
||||
fastapi==0.115.12
|
||||
pydantic==2.11.4
|
||||
pydantic==2.11.5
|
||||
uvicorn==0.34.2
|
||||
pyjwt==2.10.1
|
||||
aiofiles==24.1.0
|
||||
|
||||
Reference in New Issue
Block a user