Skip to content

Commit

Permalink
Merge pull request #10271 from freqtrade/new_release
Browse files Browse the repository at this point in the history
New release 2024.5
  • Loading branch information
xmatthias committed May 30, 2024
2 parents 0b03e4c + 8fc7056 commit 8d51a80
Show file tree
Hide file tree
Showing 431 changed files with 47,053 additions and 38,020 deletions.
11 changes: 9 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@
"editor.insertSpaces": true,
"files.trimTrailingWhitespace": true,
"[markdown]": {
"files.trimTrailingWhitespace": false,
"files.trimTrailingWhitespace": false
},
"python.pythonPath": "/usr/local/bin/python",
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff"
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort",
"charliermarsh.ruff",
"davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker",
"vscode-icons-team.vscode-icons",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/binance-lev-tier-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install ccxt
run: pip install ccxt
Expand Down
38 changes: 25 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ jobs:
- name: Run Ruff
run: |
ruff check --output-format=github .
ruff check --output-format=github
- name: Run Ruff format check
run: |
ruff format --check
- name: Mypy
run: |
Expand Down Expand Up @@ -230,7 +234,11 @@ jobs:
- name: Run Ruff
run: |
ruff check --output-format=github .
ruff check --output-format=github
- name: Run Ruff format check
run: |
ruff format --check
- name: Mypy
run: |
Expand Down Expand Up @@ -300,7 +308,11 @@ jobs:
- name: Run Ruff
run: |
ruff check --output-format=github .
ruff check --output-format=github
- name: Run Ruff format check
run: |
ruff format --check
- name: Mypy
run: |
Expand All @@ -322,7 +334,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: pre-commit dependencies
run: |
Expand All @@ -336,7 +348,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- uses: pre-commit/action@v3.0.1

docs-check:
Expand All @@ -351,7 +363,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Documentation build
run: |
Expand All @@ -377,7 +389,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Cache_dependencies
uses: actions/cache@v4
Expand Down Expand Up @@ -459,7 +471,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Build distribution
run: |
Expand Down Expand Up @@ -530,7 +542,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Extract branch name
id: extract-branch
Expand All @@ -553,12 +565,12 @@ jobs:
sudo systemctl restart docker
docker version -f '{{.Server.Experimental}}'
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v3.3.1
with:
buildx-version: latest
qemu-version: latest
uses: docker/setup-buildx-action@v1

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/devcontainer-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Devcontainer Pre-Build

on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 0"
# push:
# branches:
# - "master"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"


- name: Install pre-commit
Expand All @@ -26,9 +26,6 @@ jobs:
- name: Run auto-update
run: pre-commit autoupdate

- name: Run pre-commit
run: pre-commit run --all-files

- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ repos:
additional_dependencies:
- types-cachetools==5.3.0.7
- types-filelock==3.2.7
- types-requests==2.31.0.20240406
- types-requests==2.32.0.20240523
- types-tabulate==0.9.0.20240106
- types-python-dateutil==2.9.0.20240316
- SQLAlchemy==2.0.29
- SQLAlchemy==2.0.30
# stages: [push]

- repo: https://github.com/pycqa/isort
Expand All @@ -31,7 +31,7 @@ repos:

- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.4.2'
rev: 'v0.4.5'
hooks:
- id: ruff

Expand All @@ -56,7 +56,7 @@ repos:
)$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
Expand Down
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker",
"vscode-icons-team.vscode-icons",
"github.vscode-github-actions",
]
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ you can manually run pre-commit with `pre-commit run -a`.
mypy freqtrade
```

### 4. Ensure all imports are correct
### 4. Ensure formatting is correct

#### Run isort
#### Run ruff

``` bash
isort .
ruff format .
```

## (Core)-Committer Guide
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Please read the [exchange specific notes](docs/exchanges.md) to learn about even

- [X] [Binance](https://www.binance.com/)
- [X] [Bitmart](https://bitmart.com/)
- [X] [BingX](https://bingx.com/invite/0EM9RX)
- [X] [Gate.io](https://www.gate.io/ref/6266643)
- [X] [HTX](https://www.htx.com/) (Former Huobi)
- [X] [Kraken](https://kraken.com/)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed build_helpers/TA_Lib-0.4.28-cp39-cp39-win_amd64.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 8 additions & 11 deletions build_helpers/binance_update_lev_tiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,18 @@
import ccxt


key = os.environ.get('FREQTRADE__EXCHANGE__KEY')
secret = os.environ.get('FREQTRADE__EXCHANGE__SECRET')
key = os.environ.get("FREQTRADE__EXCHANGE__KEY")
secret = os.environ.get("FREQTRADE__EXCHANGE__SECRET")

proxy = os.environ.get('CI_WEB_PROXY')
proxy = os.environ.get("CI_WEB_PROXY")

exchange = ccxt.binance({
'apiKey': key,
'secret': secret,
'httpsProxy': proxy,
'options': {'defaultType': 'swap'}
})
exchange = ccxt.binance(
{"apiKey": key, "secret": secret, "httpsProxy": proxy, "options": {"defaultType": "swap"}}
)
_ = exchange.load_markets()

lev_tiers = exchange.fetch_leverage_tiers()

# Assumes this is running in the root of the repository.
file = Path('freqtrade/exchange/binance_leverage_tiers.json')
json.dump(dict(sorted(lev_tiers.items())), file.open('w'), indent=2)
file = Path("freqtrade/exchange/binance_leverage_tiers.json")
json.dump(dict(sorted(lev_tiers.items())), file.open("w"), indent=2)
9 changes: 3 additions & 6 deletions build_helpers/freqtrade_client_version_align.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/usr/bin/env python3
from freqtrade_client import __version__ as client_version

from freqtrade import __version__ as ft_version
from freqtrade_client import __version__ as client_version


def main():
if ft_version != client_version:
print(f"Versions do not match: \n"
f"ft: {ft_version} \n"
f"client: {client_version}")
print(f"Versions do not match: \nft: {ft_version} \nclient: {client_version}")
exit(1)
print(f"Versions match: ft: {ft_version}, client: {client_version}")
exit(0)


if __name__ == '__main__':
if __name__ == "__main__":
main()
24 changes: 13 additions & 11 deletions build_helpers/pre_commit_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@
import yaml


pre_commit_file = Path('.pre-commit-config.yaml')
require_dev = Path('requirements-dev.txt')
require = Path('requirements.txt')
pre_commit_file = Path(".pre-commit-config.yaml")
require_dev = Path("requirements-dev.txt")
require = Path("requirements.txt")

with require_dev.open('r') as rfile:
with require_dev.open("r") as rfile:
requirements = rfile.readlines()

with require.open('r') as rfile:
with require.open("r") as rfile:
requirements.extend(rfile.readlines())

# Extract types only
type_reqs = [r.strip('\n') for r in requirements if r.startswith(
'types-') or r.startswith('SQLAlchemy')]
type_reqs = [
r.strip("\n") for r in requirements if r.startswith("types-") or r.startswith("SQLAlchemy")
]

with pre_commit_file.open('r') as file:
with pre_commit_file.open("r") as file:
f = yaml.load(file, Loader=yaml.SafeLoader)


mypy_repo = [repo for repo in f['repos'] if repo['repo']
== 'https://github.com/pre-commit/mirrors-mypy']
mypy_repo = [
repo for repo in f["repos"] if repo["repo"] == "https://github.com/pre-commit/mirrors-mypy"
]

hooks = mypy_repo[0]['hooks'][0]['additional_dependencies']
hooks = mypy_repo[0]["hooks"][0]["additional_dependencies"]

errors = []
for hook in hooks:
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion docker/Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ COPY build_helpers/* /tmp/
COPY --chown=ftuser:ftuser requirements.txt /freqtrade/
USER ftuser
RUN pip install --user --no-cache-dir numpy \
&& pip install --user --no-index --find-links /tmp/ pyarrow TA-Lib==0.4.28 \
&& pip install --user --no-index --find-links /tmp/ pyarrow TA-Lib \
&& pip install --user --no-cache-dir -r requirements.txt

# Copy dependencies to runtime-image
Expand Down
Binary file added docs/assets/freqUI-backtesting-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/freqUI-backtesting-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/freqUI-plot-configurator-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/freqUI-plot-configurator-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/freqUI-trade-pane-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/freqUI-trade-pane-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/freqUI-trade-pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/frequi-login-CORS-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/frequi-login-CORS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/frequi-settings-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/frequi-settings-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 27 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,14 @@ The possible values are: `GTC` (default), `FOK` or `IOC`.
This is ongoing work. For now, it is supported only for binance, gate and kucoin.
Please don't change the default value unless you know what you are doing and have researched the impact of using different values for your particular exchange.

### What values can be used for fiat_display_currency?
### Fiat conversion

Freqtrade uses the Coingecko API to convert the coin value to it's corresponding fiat value for the Telegram reports.
The FIAT currency can be set in the configuration file as `fiat_display_currency`.

Removing `fiat_display_currency` completely from the configuration will skip initializing coingecko, and will not show any FIAT currency conversion. This has no importance for the correct functioning of the bot.

#### What values can be used for fiat_display_currency?

The `fiat_display_currency` configuration parameter sets the base currency to use for the
conversion from coin to fiat in the bot Telegram reports.
Expand All @@ -587,7 +594,25 @@ The valid values are:
"BTC", "ETH", "XRP", "LTC", "BCH", "BNB"
```

Removing `fiat_display_currency` completely from the configuration will skip initializing coingecko, and will not show any FIAT currency conversion. This has no importance for the correct functioning of the bot.
#### Coingecko Rate limit problems

On some IP ranges, coingecko is heavily rate-limiting.
In such cases, you may want to add your coingecko API key to the configuration.

``` json
{
"fiat_display_currency": "USD",
"coingecko": {
"api_key": "your-api",
"is_demo": true
}
}
```

Freqtrade supports both Demo and Pro coingecko API keys.

The Coingecko API key is NOT required for the bot to function correctly.
It is only used for the conversion of coin to fiat in the Telegram reports, which usually also work without API key.

## Using Dry-run mode

Expand Down
Loading

0 comments on commit 8d51a80

Please sign in to comment.