The MacheteV8b strategy is a trading strategy implemented as a class that inherits from the IStrategy class. Here's a short description of what the strategy does:
The populate_indicators method is called to populate various indicators based on the input dataframe and metadata. The method checks if there is a custom trade information for the given trading pair in the custom_trade_info dictionary.
If not, it populates trades for that pair.
If there is no available data for backtesting, the method returns the original dataframe.
It retrieves buy signal indicators using the get_buy_signal_indicators method and the input dataframe and metadata. It retrieves market condition indicators using the get_market_condition_indicators method and an informative dataframe based on the input timeframe. Custom stop-loss indicators are calculated using the get_custom_stoploss_indicators method and the informative dataframe. The merge_informative_pair function is called to merge the informative dataframe with the original dataframe based on the specified timeframes. Columns in the dataframe are renamed to include "_inf" to indicate informative data. If the run mode is either "backtest" or "hyperopt," specific columns from the dataframe are stored in the custom_trade_info dictionary for future reference. The method returns the updated dataframe. The strategy also includes various calculations for technical indicators using the ta and qtpylib libraries. Some of the indicators used in the strategy include ADX, Awesome Oscillator, MACD, Plus Directional Indicator (+DI), Minus Directional Indicator (-DI), SAR, Momentum, Simple Moving Averages (SMA), Exponential Moving Averages (EMA), Hull Moving Average (HMA), Commodity Channel Index (CCI), Relative Strength Index (RSI), Rate of Change (ROC), Fisher Transform of RSI, Bollinger Bands, Stochastic Fast, Heikin-Ashi, Chaikin Money Flow (CMF), Ichimoku Cloud, and SSL Channels. Additionally, the strategy calculates specific conditions and flags based on the calculated indicators, such as future trend predictions, high points, low points, and trend directions. Please note that the description provided is based solely on the code snippet provided and may not fully capture the complete functionality or intent of the strategy.
Traceback (most recent call last):
File "index.pyx", line 598, in pandas._libs.index.DatetimeEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 2606, in pandas._libs.hashtable.Int64HashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 2630, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 1717205460000000000
During handling of the above exception, another exception occurred:
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 566, in pandas._libs.index.DatetimeEngine.get_loc
File "index.pyx", line 600, in pandas._libs.index.DatetimeEngine.get_loc
KeyError: Timestamp('2024-06-01 01:31:00+0000', tz='UTC')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/indexes/datetimes.py", line 631, in get_loc
return Index.get_loc(self, 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: Timestamp('2024-06-01 01:31:00+0000', tz='UTC')
The above exception was the direct cause of the following exception:
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/MacheteV8b.py", line 596, in custom_stoploss
sroc = self.custom_trade_info[trade.pair]['sroc_inf'].loc[current_time]['sroc_inf']
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/indexing.py", line 1153, in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/indexing.py", line 1393, in _getitem_axis
return self._get_label(key, axis=axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/indexing.py", line 1343, in _get_label
return self.obj.xs(label, axis=axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/generic.py", line 4236, in xs
loc = index.get_loc(key)
^^^^^^^^^^^^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/indexes/datetimes.py", line 633, in get_loc
raise KeyError(orig_key) from err
KeyError: datetime.datetime(2024, 6, 1, 1, 31, tzinfo=datetime.timezone.utc)