-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adjust_trade_position does not exit Trade #10166
Comments
Where is the config used, and the full backtest result? |
@stash86 Let me know if I can help, I tried to debug a bit but it seems unclear to me where exactly the exit should be called |
Okay, confirmed the bug. Gonna try to see why it's bugged |
@xmatthias apparently the backtest trade isn't being closed properly backtesting.py
trade_model.py
As you can see, the bot keeps trying to close the trade over and over |
3 tasks
xmatthias
added a commit
that referenced
this issue
May 4, 2024
xmatthias
added a commit
that referenced
this issue
May 4, 2024
xmatthias
added a commit
that referenced
this issue
May 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe your environment
python -V
)pip freeze | grep ccxt
)freqtrade -V
ordocker compose run --rm freqtrade -V
for Freqtrade running in docker)Describe the problem:
When returning -trade.stake_amount in adjust_trade_position the trade does not exit.
Steps to reproduce:
Use any Strategy, add return -trade.stake_amount in adjust_trade_position and confirm that only one trade is being made. E.g for Strategy001:
This is not dependent on a specific if clause surrounding the return. Thats why the example above has it very badly placed as this would sell right away IF IT WOULD SELL (it doesn't).
Observed Results:
Without trade adjustments it results in more than one trade, with trade adjustment its exactly one trade as it never fully exits. I also debugged it a bit to backtest.py but the remaining value is 0 (in here: https://github.com/freqtrade/freqtrade/blob/e2a9bc9c6491ee22d5d36815e03356f5e5b5cb8e/freqtrade/optimize/backtesting.py#L583C13-L583C22) so I guess it should just exit but does not
The text was updated successfully, but these errors were encountered: