iterativv / NostalgiaForInfinity

Trading strategy for the Freqtrade crypto bot
GNU General Public License v3.0
1.92k stars 482 forks source link

ERROR - Fatal exception! while running to only backtest the NostalgiaForInfinityX4 strategy #393

Closed Jorman closed 3 months ago

Jorman commented 3 months ago

Hi, I just discovered this, very very impressive work!!! I came from one "old" strategy NFI5MOHO_WIP found on internet, and this "old" is a pretty good results on backtesting. Then I followed the link and I discovered this one, and I tried to test it in the same way but I got error during the backtest

2024-04-04 11:55:20,851 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
  File "/freqtrade/freqtrade/main.py", line 42, in main
    return_code = args['func'](args)
                  ^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/commands/optimize_commands.py", line 58, in start_backtesting
    backtesting.start()
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 1401, in start
    min_date, max_date = self.backtest_one_strategy(strat, data, timerange)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 1318, in backtest_one_strategy
    preprocessed = self.strategy.advise_all_indicators(data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/interface.py", line 1378, in advise_all_indicators
    return {pair: self.advise_indicators(pair_data.copy(), {'pair': pair}).copy()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/interface.py", line 1378, in <dictcomp>
    return {pair: self.advise_indicators(pair_data.copy(), {'pair': pair}).copy()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/interface.py", line 1410, in advise_indicators
    return self.populate_indicators(dataframe, metadata)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/user_data/strategies/NostalgiaForInfinityX4.py", line 19340, in populate_indicators
    df = merge_informative_pair(df, btc_informative, self.timeframe, btc_info_timeframe, ffill=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/freqtrade/freqtrade/strategy/strategy_helper.py", line 62, in merge_informative_pair
    raise ValueError("Tried to merge a faster timeframe to a slower timeframe."
ValueError: Tried to merge a faster timeframe to a slower timeframe.This would create new rows, and can throw off your regular indicators.

I'm using Freqtrade 2024.3 via docker on windows machine, in my case is faster than my nas! Maybe I make some mistake? I tried the same way I did backtests pre the "old" strategy, however maybe this one needs some different library to be installed in Freqtrade? Any idea?

iterativv commented 3 months ago

Yes, please remove any references to timeframe from your config ... NFI is 5m, but is using other timeframes for indicators too.

Jorman commented 3 months ago

Perfect, thank you for the information!