freqtrade / freqtrade-strategies

Free trading strategies for Freqtrade bot
GNU General Public License v3.0
3.44k stars 1.13k forks source link

GodStra strat can't find ta module #279

Closed tomjrtsmith closed 2 years ago

tomjrtsmith commented 2 years ago

Describe your environment

Note: All bug reports will be closed without further comment if the above template is deleted or not filled out.

Describe the problem:

Explain the problem you have encountered Strat seems to be looking for talib abstract despite TALib being present. I tried uncommenting out line 24 to no avail. Also reinstalled TA lib using pip install ta as per code instructions. This reinstalled TALib + dependencies but still won't run.

Steps to reproduce:

  1. Load Godtra strat
  2. run from command line

Observed Results:

Relevant code exceptions or logs

Note: Please copy/paste text of the messages, no screenshots of logs please.

Dec  3 21:46:29 instance-20221009-1127 freqtrade_a[279285]: 2022-12-03 21:46:29,643 - freqtrade.resolvers.iresolver - WARNING - Could not import /home/ubuntu/freqtrade/user_data/strategies/GodStra.py due to 'No module named 'ta''
xmatthias commented 2 years ago

ta is not ta-lib (which imports as talib) - but it's the ta library. That's a dependency freqtrade does not depend on - so it's up to the user to make sure to install it if he want's to use it.

tomjrtsmith commented 2 years ago

I installed it and unless I'm mistaken it has a compatibility issue which would make all the strats that use it currently unusable ... I've included the error log.


Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]: 2022-12-04 08:45:40,457 - freqtrade.commands.trade_commands - ERROR - Fatal exception!
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]: Traceback (most recent call last):
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/commands/trade_commands.py", line 18, in start_trading
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     worker = Worker(args)
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/worker.py", line 37, in __init__
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     self._init(False)
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/worker.py", line 53, in _init
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     self.freqtrade = FreqtradeBot(self._config)
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/freqtradebot.py", line 62, in __init__
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     self.strategy: IStrategy = StrategyResolver.load_strategy(self.config)
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 48, in load_strategy
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     strategy: IStrategy = StrategyResolver._load_strategy(
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 256, in _load_strategy
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     strategy = StrategyResolver._load_object(
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/resolvers/iresolver.py", line 148, in _load_object
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     (module, module_path) = cls._search_object(directory=_path,
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/resolvers/iresolver.py", line 130, in _search_object
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     obj = next(cls._get_valid_object(module_path, object_name), None)
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/freqtrade/resolvers/iresolver.py", line 91, in _get_valid_object
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     spec.loader.exec_module(module)  # type: ignore # importlib does not use typehints
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/user_data/strategies/Strategy005.py", line 9, in <module>
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     import talib.abstract as ta
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "/home/ubuntu/freqtrade/.env/lib/python3.10/site-packages/talib/__init__.py", line 93, in <module>
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:     from ._ta_lib import (
Dec  4 08:45:40 instance-20221009-1127 freqtrade.configuration.configuration - INFO - Dry run is enabled
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]:   File "talib/_ta_lib.pyx", line 1, in init talib._ta_lib
Dec  4 08:45:40 instance-20221009-1127 freqtrade_a[281309]: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject ```
xmatthias commented 2 years ago

reinstall ta-lib with the latest numpy. This has nothing to do with ta.