diff --git a/.gitignore b/.gitignore index 23f505ea0..c2c9c0811 100644 --- a/.gitignore +++ b/.gitignore @@ -1,110 +1,110 @@ -# Freqtrade rules -config*.json -*.sqlite -*.sqlite-shm -*.sqlite-wal -logfile.txt -user_data/* -!user_data/strategy/sample_strategy.py -!user_data/notebooks -user_data/notebooks/* -freqtrade-plot.html -freqtrade-profit-plot.html -freqtrade/rpc/api_server/ui/* - -# Macos related -.DS_Store - -# git files after merging -*.orig - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -*.ipynb_checkpoints - -# pyenv -.python-version - -.env -.venv -.idea -.vscode - -.pytest_cache/ -.mypy_cache/ - -#exceptions -!*.gitkeep -!config_examples/config_binance.example.json -!config_examples/config_bittrex.example.json -!config_examples/config_ftx.example.json -!config_examples/config_full.example.json -!config_examples/config_kraken.example.json +# Freqtrade rules +config*.json +*.sqlite +*.sqlite-shm +*.sqlite-wal +logfile.txt +user_data/* +!user_data/strategy/sample_strategy.py +!user_data/notebooks +user_data/notebooks/* +freqtrade-plot.html +freqtrade-profit-plot.html +freqtrade/rpc/api_server/ui/* + +# Macos related +.DS_Store + +# git files after merging +*.orig + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +*.ipynb_checkpoints + +# pyenv +.python-version + +.env +.venv +.idea +.vscode + +.pytest_cache/ +.mypy_cache/ + +#exceptions +!*.gitkeep +!config_examples/config_binance.example.json +!config_examples/config_bittrex.example.json +!config_examples/config_ftx.example.json +!config_examples/config_full.example.json +!config_examples/config_kraken.example.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 31af5b7c7..3d184be7e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,34 @@ repos: rev: 'v0.942' hooks: - id: mypy - # stages: [push] + pass_filenames: false # suppress the normal filename passing + files: ^freqtrade/ # filter the files down to a specific subdirectory + # pre-commit only supports running at the root of a repo since that's where + # git hooks run. but it also allows running arbitrary code so you can + # step outside of those bounds + # note that `bash` will reduce your portability slightly + verbose: true + entry: mypy freqtrade + additional_dependencies: + - types-cachetools==5.0.0 + - types-filelock==3.2.5 + - types-python-dateutil==2.8.10 + - types-requests==2.27.15 + - types-tabulate==0.8.6 + - types-urllib3==1.26.11 + + - id: mypy + pass_filenames: false + files: ^scripts/ + entry: mypy scripts + additional_dependencies: + - types-cachetools==5.0.0 + - types-filelock==3.2.5 + - types-python-dateutil==2.8.10 + - types-requests==2.27.15 + - types-tabulate==0.8.6 + - types-urllib3==1.26.11 + - repo: https://github.com/pycqa/isort rev: '5.10.1' diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 8b672116f..57dffbdc8 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -578,7 +578,7 @@ class Backtesting: ): trade.exit_reason = row[EXIT_TAG_IDX] - return self._exit_trade(trade, sell_row, close_rate) + return self._exit_trade(trade, row, close_rate) return None