freqtrade / freqtrade

Free, open source crypto trading bot

Home Page:https://www.freqtrade.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different results with same parameters

k4pak opened this issue · comments

commented

Describe your environment

  • Operating system: _ubuntu
  • Python Version: 3.11_ (python -V)
  • CCXT version: _____ (pip freeze | grep ccxt)
  • Freqtrade Version: ____ (freqtrade -V or docker compose run --rm freqtrade -V for Freqtrade running in docker)

Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.

Describe the problem:

Different results with same parameters for hyperopt and backtesting

Explain the problem you have encountered

i have checked all my parameters and they are all the same . i have done backtesting with hyperopt results parameters but the results im facing are different .

Steps to reproduce:




Observed Results:

  • What happened?
  • i have use this command for hyper optimization :
  • freqtrade hyperopt --hyperopt-loss OnlyProfitHyperOptLoss --strategy knockoptv12 --c user_data/config_futures.json -i 4h -e 200 -j 10 --timerange 20220601-20240101 --spaces buy --random-state 100

AND

this is a command i have used for backtesting :
freqtrade backtesting --strategy knockoptv12 --config user_data/config_futures.json --timerange 20220601-20240101

  • What did you expect to happen?
    i would have expected to see a same results but the results are different .

Backtested 2022-06-01 00:00:00 -> 2024-01-01 00:00:00 | Max open trades : 1
========================================================================= STRATEGY SUMMARY =========================================================================
| Strategy | Entries | Avg Profit % | Cum Profit % | Tot Profit USDT | Tot Profit % | Avg Duration | Win Draw Loss Win% | Drawdown |
|-------------+-----------+----------------+----------------+-------------------+----------------+------------------+-------------------------+--------------------|
| knockoptv12 | 14 | 2.35 | 32.92 | 318.418 | 31.84 | 7 days, 17:43:00 | 3 0 11 21.4 | 100.87 USDT 9.61% |

this is hyperopt results :

  • 7/200: 12 trades. 4/0/8 Wins/Draws/Losses. Avg profit 6.44%. Median profit -1.63%. Total profit 888.28491067 USDT ( 88.83%). Avg duration 13 days, 11:00:00 min. Objective: -888.28491

can you provide the full output of the backtesting command? (please use tripple backticks for formatting).

Make sure you put the calculations for want-to-be-hyperopted inside populate_entry, and not on populate_indicators, as mentioned here https://www.freqtrade.io/en/stable/hyperopt/#why-do-my-backtest-results-not-match-my-hyperopt-results

It's recommended to fully read the docs for relevant command at least once before you start using the command. In this case, please try to read the whole hyperopt section.

commented

can you provide the full output of the backtesting command? (please use tripple backticks for formatting).

thank you my problem has been solved by STASH86 answer .. thank you for attention mate

My suspicion was on the timeframe - it's explicitly set to -i 4h on hyperopt - but that parameter is missing on backtesting - which can also be a cause of missmatches ;)

Anyway, glad you got it sorted 💯