freqtrade / freqtrade-strategies

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

ta not installing on Google cloud instance and all futures strategies are not working #299

Closed tenebreux closed 1 year ago

tenebreux commented 1 year ago

Describe your environment

Describe the problem:

there is an issue to get the ta lib that's used in all strategies installed on Google's cloud instances. Because of that all the strategies that use ta don't get loaded in freqtrade

Steps to reproduce:

  1. Install docker on google cloud instance
  2. install freqtrade in docker
  3. use any strategy that imports the ta library

Observed Results:

Nothing. It doesn't start.

Relevant code exceptions or logs

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

2023-03-24 05:48:48,161 - freqtrade.commands.trade_commands - ERROR - Impossible to load Strategy 'EMAPriceCrossoverWithThreshold.py'. This class does not exist or contains Python code errors.
freqtrade  | 2023-03-24 05:48:48,162 - freqtrade.commands.trade_commands - ERROR - Fatal exception!
freqtrade  | Traceback (most recent call last):
freqtrade  |   File "/freqtrade/freqtrade/commands/trade_commands.py", line 24, in start_trading
freqtrade  |     worker = Worker(args)
freqtrade  |   File "/freqtrade/freqtrade/worker.py", line 37, in __init__
freqtrade  |     self._init(False)
freqtrade  |   File "/freqtrade/freqtrade/worker.py", line 53, in _init
freqtrade  |     self.freqtrade = FreqtradeBot(self._config)
freqtrade  |   File "/freqtrade/freqtrade/freqtradebot.py", line 63, in __init__
freqtrade  |     self.strategy: IStrategy = StrategyResolver.load_strategy(self.config)
freqtrade  |   File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 48, in load_strategy
freqtrade  |     strategy: IStrategy = StrategyResolver._load_strategy(
freqtrade  |   File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 274, in _load_strategy
freqtrade  |     raise OperationalException(
freqtrade  | freqtrade.exceptions.OperationalException: Impossible to load Strategy 'EMAPriceCrossoverWithThreshold.py'. This class does not exist or contains Python code errors.
freqtrade exited with code 0
xmatthias commented 1 year ago

your usage is wrong - which is causing the error. EMAPriceCrossoverWithThreshold.py is not a valid python class name - but is a filename. Best read the documentation if it's unclear how to use this.


Regarding your question about ta: Freqtrade does install some technical indicator librararies as dependencies (pandas-ta, ta-lib, technical).

It will however not (and also won't attempt to) install all possible libraries strategies (or also strategy samples provided in this repository). It's the user's responsability to ensure the dependencies are installed (you can usually install it with pip install <yourlibrary>). Often, strategies will also provide a hint about this.

EMAPriceCrossoverWithThreshold.py (or the actual strategy name, EMAPriceCrossoverWithThreshold) is however not a strategy provided here - therefore we also can't provide guidance as to what is ACTUALLY needed.

tenebreux commented 1 year ago

Thanks for helping Mathias. It's still not working. Can you recommend another strategy i can try?

i still get the same error:

freqtrade | 2023-03-24 06:18:48,584 - freqtrade.strategy.hyper - INFO - Found no parameter file. freqtrade | 2023-03-24 06:18:48,585 - freqtrade.commands.trade_commands - ERROR - populate_entry_trend must be implemented. freqtrade | 2023-03-24 06:18:48,585 - freqtrade.commands.trade_commands - ERROR - Fatal exception! freqtrade | Traceback (most recent call last): freqtrade | File "/freqtrade/freqtrade/commands/trade_commands.py", line 24, in start_trading freqtrade | worker = Worker(args) freqtrade | File "/freqtrade/freqtrade/worker.py", line 37, in init freqtrade | self._init(False) freqtrade | File "/freqtrade/freqtrade/worker.py", line 53, in _init freqtrade | self.freqtrade = FreqtradeBot(self._config) freqtrade | File "/freqtrade/freqtrade/freqtradebot.py", line 63, in init freqtrade | self.strategy: IStrategy = StrategyResolver.load_strategy(self.config) freqtrade | File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 48, in load_strategy freqtrade | strategy: IStrategy = StrategyResolver._load_strategy( freqtrade | File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 272, in _load_strategy freqtrade | return StrategyResolver.validate_strategy(strategy) freqtrade | File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 172, in validate_strategy freqtrade | raise OperationalException("populate_entry_trend must be implemented.") freqtrade | freqtrade.exceptions.OperationalException: populate_entry_trend must be implemented. freqtrade exited with code 0 freqtrade | 2023-03-24 06:18:53,098 - freqtrade - INFO - freqtrade 2023.2 freqtrade | 2023-03-24 06:18:53,323 - freqtrade.worker - INFO - Starting worker 2023.2 freqtrade | 2023-03-24 06:18:53,323 - freqtrade.configuration.load_config - INFO - Using config: /freqtrade/user_data/config.json ... freqtrade | 2023-03-24 06:18:53,325 - freqtrade.loggers - INFO - Verbosity set to 0 freqtrade | 2023-03-24 06:18:53,325 - freqtrade.configuration.configuration - INFO - Runmode set to live. freqtrade | 2023-03-24 06:18:53,326 - freqtrade.configuration.configuration - INFO - Parameter --db-url detected ... freqtrade | 2023-03-24 06:18:53,326 - freqtrade.configuration.configuration - INFO - Dry run is disabled freqtrade | 2023-03-24 06:18:53,326 - freqtrade.configuration.configuration - INFO - Using DB: "sqlite:////freqtrade/user_data/tradesv3.sqlite" freqtrade | 2023-03-24 06:18:53,326 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 5 ... freqtrade | 2023-03-24 06:18:53,337 - freqtrade.configuration.configuration - INFO - Using user-data directory: /freqtrade/user_data ... freqtrade | 2023-03-24 06:18:53,337 - freqtrade.configuration.configuration - INFO - Using data directory: /freqtrade/user_data/data/binance ... freqtrade | 2023-03-24 06:18:53,338 - freqtrade.exchange.check_exchange - INFO - Checking exchange... freqtrade | 2023-03-24 06:18:53,354 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team. freqtrade | 2023-03-24 06:18:53,354 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration. freqtrade | 2023-03-24 06:18:53,375 - freqtrade.resolvers.iresolver - INFO - Using resolved strategy EMAPriceCrossoverWithThreshold from '/freqtrade/user_data/strategies/EMAPriceCrossoverWithThreshold.py'... freqtrade | 2023-03-24 06:18:53,375 - freqtrade.strategy.hyper - INFO - Found no parameter file. freqtrade | 2023-03-24 06:18:53,376 - freqtrade.commands.trade_commands - ERROR - populate_entry_trend must be implemented. freqtrade | 2023-03-24 06:18:53,376 - freqtrade.commands.trade_commands - ERROR - Fatal exception! freqtrade | Traceback (most recent call last): freqtrade | File "/freqtrade/freqtrade/commands/trade_commands.py", line 24, in start_trading freqtrade | worker = Worker(args) freqtrade | File "/freqtrade/freqtrade/worker.py", line 37, in init freqtrade | self._init(False) freqtrade | File "/freqtrade/freqtrade/worker.py", line 53, in _init freqtrade | self.freqtrade = FreqtradeBot(self._config) freqtrade | File "/freqtrade/freqtrade/freqtradebot.py", line 63, in init freqtrade | self.strategy: IStrategy = StrategyResolver.load_strategy(self.config) freqtrade | File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 48, in load_strategy freqtrade | strategy: IStrategy = StrategyResolver._load_strategy( freqtrade | File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 272, in _load_strategy freqtrade | return StrategyResolver.validate_strategy(strategy) freqtrade | File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 172, in validate_strategy freqtrade | raise OperationalException("populate_entry_trend must be implemented.") freqtrade | freqtrade.exceptions.OperationalException: populate_entry_trend must be implemented. freqtrade exited with code 0

xmatthias commented 1 year ago

Strategies in this repository should normally load just fine.

Your strategy seems to either use an old interface with new functionalities (namely, using short) - or is not properly implementing the interface.