iterativv / NostalgiaForInfinity

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

Unexpected error unsupported operand type(s) for *: 'float' and 'NoneType' #325

Closed xxme closed 10 months ago

xxme commented 1 year ago

Hello @iterativv ! When I hold Trade, the following error will be displayed. `freqtrade.strategy.strategy_wrapper - ERROR - Unexpected error unsupported operand type(s) for : 'float' and 'NoneType' calling <bound method NostalgiaForInfinityX4.adjust_trade_position of <NostalgiaForInfinityX4.NostalgiaForInfinityX4 object at 0xfffcef8a92d0>> Traceback (most recent call last): File "/freqtrade/freqtrade/strategy/strategy_wrapper.py", line 27, in wrapper return f(args, *kwargs) ^^^^^^^^^^^^^^^^^^ File "/freqtrade/user_data/strategies/NostalgiaForInfinityX4.py", line 1553, in adjust_trade_position return self.grind_adjust_trade_position(trade, current_time, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/user_data/strategies/NostalgiaForInfinityX4.py", line 1605, in grind_adjust_trade_position profit_stake, profit_ratio, profit_current_stake_ratio, profit_init_ratio = self.calc_total_profit(trade, filled_entries, filled_exits, exit_rate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/user_data/strategies/NostalgiaForInfinityX4.py", line 1423, in calc_total_profit current_stake = (trade.amount exit_rate * (1 - trade.fee_close))


TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'`

The error will continue until all Trades are sold.
Running strategy on
Live mode
trading mode: futures

NostalgiaForInfinityX4  v14.0.282

Any idea how to solve that? Thank you
drybx commented 1 year ago

NFI does not support futures yet. Make sure your freqtrade is up to date. For future questions, please use the discord.

jurekl commented 1 year ago

Whether NFI supports futures or not is completely irrelevant. The OP points out a specific case of an unhandled error in the NFI code.

iterativv commented 12 months ago

Any idea how to solve that? Thank you

Hi. Looking into it ...

Let me know if the latest update fixed it.

xxme commented 11 months ago

Any idea how to solve that? Thank you

Hi. Looking into it ...

Let me know if the latest update fixed it.

It has been fixed, thank you very much!

iterativv commented 10 months ago

Great !