The BBMCE2 trading strategy is implemented as a class that inherits from the IStrategy class. It involves several technical indicators and conditions to determine entry and exit points for trading. Here's a brief overview:
Indicator Calculation (populate_indicators method):
Moving Averages: Calculates Simple Moving Average (SMA) with periods 15.
Relative Strength Index (RSI): Calculates RSI with periods 14, 4, and 20.
Average Directional Index (ADX): Computes ADX.
Stochastic Oscillator: Computes fast %K and %D values using Stochastic indicator with a window of 14. Custom Trend Index (CTI): Calculates a custom trend index using a rolling mean of the close price. Other indicators like TEMA, PLUS_DI, MINUS_DI, MFI, EMA, Williams %R, EWO (Elliott Wave Oscillator), etc., are computed. Entry Conditions (populate_entry_trend method):
Multiple conditions are checked for different trading scenarios, including COFI, EWO, and NFI_32. For each condition met, an associated tag is added to the 'enter_tag' column. If any of the conditions are met, the 'enter_long' column is set to 1, indicating a potential entry. Exit Conditions (populate_exit_trend method):
Exit conditions are determined, including a fast %K crossover. Similar to the entry conditions, an associated tag is added to the 'exit_tag' column for each condition met. If any exit condition is satisfied, the 'exit_long' column is set to 1, indicating a potential exit. Leverage Calculation (get_leverage method):
This method calculates the proposed leverage based on the 'leverage_num' parameter. The strategy appears to involve a combination of various technical indicators and their respective threshold-based conditions to determine potential entry and exit points. These conditions consider factors like moving averages, oscillators, trend indices, and more to make trading decisions. Please note that while this description provides an overview of the strategy's functionality, the actual effectiveness of the strategy can only be determined through thorough backtesting and evaluation.
Traceback (most recent call last):
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3791, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "index.pyx", line 152, in pandas._libs.index.IndexEngine.get_loc
File "index.pyx", line 181, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'EWO'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/freqtrade/freqtrade/main.py", line 42, in main
return_code = args['func'](args)
^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/commands/optimize_commands.py", line 58, in start_backtesting
backtesting.start()
File "/freqtrade/freqtrade/optimize/backtesting.py", line 1401, in start
min_date, max_date = self.backtest_one_strategy(strat, data, timerange)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/optimize/backtesting.py", line 1318, in backtest_one_strategy
preprocessed = self.strategy.advise_all_indicators(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/strategy/interface.py", line 1378, in advise_all_indicators
return {pair: self.advise_indicators(pair_data.copy(), {'pair': pair}).copy()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/strategy/interface.py", line 1378, in
return {pair: self.advise_indicators(pair_data.copy(), {'pair': pair}).copy()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/strategy/interface.py", line 1410, in advise_indicators
return self.populate_indicators(dataframe, metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/user_data/strategies/BBMCE2.py", line 157, in populate_indicators
((dataframe['EWO'] > 5.6) &
~~~~~~~~~^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/frame.py", line 3893, in __getitem__
indexer = self.columns.get_loc(key)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3798, in get_loc
raise KeyError(key) from err
KeyError: 'EWO'