Closed LightDelphin closed 4 years ago
Seems like the imports at the top are missing .
by default, these are the following.
# --- Do not remove these libs ---
from freqtrade.strategy.interface import IStrategy
from typing import Dict, List
from functools import reduce
from pandas import DataFrame
# --------------------------------
Seems like the imports at the top are missing .
by default, these are the following.
# --- Do not remove these libs --- from freqtrade.strategy.interface import IStrategy from typing import Dict, List from functools import reduce from pandas import DataFrame # --------------------------------
Thank.
Now the following errors:
2020-05-26 11:33:19,593 - freqtrade.freqtradebot - INFO - Starting freqtrade develop 2020-05-26 11:33:19,617 - freqtrade.resolvers.iresolver - INFO - Using resolved strategy strategy002 from '/home/freqtrade/1/user_data/strategies/strategy002.py'... 2020-05-26 11:33:19,617 - freqtrade - ERROR - Fatal exception! Traceback (most recent call last): File "/home/freqtrade/1/freqtrade/main.py", line 36, in main return_code = args['func'](args) File "/home/freqtrade/1/freqtrade/commands/trade_commands.py", line 19, in start_trading worker = Worker(args) File "/home/freqtrade/1/freqtrade/worker.py", line 34, in init self._init(False) File "/home/freqtrade/1/freqtrade/worker.py", line 53, in _init self.freqtrade = FreqtradeBot(self._config) File "/home/freqtrade/1/freqtrade/freqtradebot.py", line 59, in init self.strategy: IStrategy = StrategyResolver.load_strategy(self.config) File "/home/freqtrade/1/freqtrade/resolvers/strategy_resolver.py", line 47, in load_strategy extra_dir=config.get('strategy_path')) File "/home/freqtrade/1/freqtrade/resolvers/strategy_resolver.py", line 165, in _load_strategy kwargs={'config': config}) File "/home/freqtrade/1/freqtrade/resolvers/iresolver.py", line 113, in _load_object return module(**kwargs) TypeError: Can't instantiate abstract class strategy002 with abstract methods populate_buy_trend, populate_indicators, populate_sell_trend
We provide documentation based on a strategy template, which provides you with a raw scaffold (but runnable) where you can add your own strategy indicators and parameters.
Please read the documentation - and best start from the strategy template we provide.
If you're starting from an empty strategy, then the assumption is that you're able to debug such errors yourself. We are not a company providing support, but an open source project, where people donate their time for free to help other people. Such questions can be avoided by reading the documentation - and we expect that people do that. Thanks for your understanding.
For requestion a new strategy. Please use the template below.
Any strategy request that does not follow the template will be closed.
Step 1: What indicators are required?
I can’t start the bot on this strategy
Step 2: Explain the Buy Strategy
Trying to run a fibonacci strategy file.
` import numpy as np from numpy.core.records import ndarray from pandas import Series, DataFrame from math import log
class strategy002(IStrategy): """ Strategy 001 """
Minimal ROI designed for the strategy.
def fibonacci_retracements(df, field='close') -> DataFrame:
Общие пороги:
error
2020-05-26 10:08:29,340 - freqtrade.freqtradebot - INFO - Starting freqtrade develop 2020-05-26 10:08:29,362 - freqtrade - ERROR - Fatal exception! Traceback (most recent call last): File "/home/1/freqtrade/freqtrade/main.py", line 36, in main return_code = args['func'](args) File "/home/1/freqtrade/freqtrade/commands/trade_commands.py", line 19, in start_trading worker = Worker(args) File "/home/1/freqtrade/freqtrade/worker.py", line 34, in init self._init(False) File "/home/1/freqtrade/freqtrade/worker.py", line 53, in _init self.freqtrade = FreqtradeBot(self._config) File "/home/1/freqtrade/freqtrade/freqtradebot.py", line 59, in init self.strategy: IStrategy = StrategyResolver.load_strategy(self.config) File "/home/1/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 47, in load_strategy extra_dir=config.get('strategy_path')) File "/home/1/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 165, in _load_strategy kwargs={'config': config}) File "/home/1/freqtrade/freqtrade/resolvers/iresolver.py", line 108, in _load_object object_name=object_name) File "/home/1/freqtrade/freqtrade/resolvers/iresolver.py", line 92, in _search_object obj = next(cls._get_valid_object(module_path, object_name), None) File "/home/1/freqtrade/freqtrade/resolvers/iresolver.py", line 61, in _get_valid_object spec.loader.exec_module(module) # type: ignore # importlib does not use typehints File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/1/freqtrade/user_data/strategies/strategy002.py", line 10, in <module> class strategy002(IStrategy): NameError: name 'IStrategy' is not defined
Tell me what is missing, please?