ssssi / freqtrade_strs

Trading Strategies for Freqtrade
241 stars 72 forks source link

Issue: NameError: name 'remove_pubid' is not defined during backtest #20

Open gorsek1 opened 1 month ago

gorsek1 commented 1 month ago

Hello,

When attempting to backtest your strategy, I encountered the following error:

2024-08-08 08:43:52,423 - freqtrade.strategy.strategy_wrapper - ERROR - Unexpected error name 'remove_pubid' is not defined calling <bound method E0V1E_ssssi.custom_exit of <E0V1E_ssssi.E0V1E_ssssi object at 0x7377e18d19f0>> Traceback (most recent call last): File "/home/freqtrade/freqtrade/strategy/strategy_wrapper.py", line 28, in wrapper return f(*args, **kwargs) File "/home/freqtrade/user_data/strategies/E0V1E_ssssi.py", line 99, in custom_exit remove_pubid(trade.id) NameError: name 'remove_pubid' is not defined

i have tried with a simple fix at the start of the strategy and now this error is gone:

//Define the remove_pubid function def remove_pubid(trade_id): try: TMP_HOLD120.remove(trade_id) except ValueError: pass

But I dont know what this pub.id does. Can i just ignore this error?

p4w4n commented 3 weeks ago

I am getting the same issue while running the hyperopt.

ammarti commented 2 weeks ago

i'm getting the same with hyperopt

ssssi commented 1 week ago

Hello,

When attempting to backtest your strategy, I encountered the following error:

2024-08-08 08:43:52,423 - freqtrade.strategy.strategy_wrapper - ERROR - Unexpected error name 'remove_pubid' is not defined calling <bound method E0V1E_ssssi.custom_exit of <E0V1E_ssssi.E0V1E_ssssi object at 0x7377e18d19f0>> Traceback (most recent call last): File "/home/freqtrade/freqtrade/strategy/strategy_wrapper.py", line 28, in wrapper return f(*args, **kwargs) File "/home/freqtrade/user_data/strategies/E0V1E_ssssi.py", line 99, in custom_exit remove_pubid(trade.id) NameError: name 'remove_pubid' is not defined

i have tried with a simple fix at the start of the strategy and now this error is gone:

//Define the remove_pubid function def remove_pubid(trade_id): try: TMP_HOLD120.remove(trade_id) except ValueError: pass

But I dont know what this pub.id does. Can i just ignore this error?

yes,you can,i had remove it