The CryptoFrog strategy is a backtesting trading strategy designed for cryptocurrency trading. It implements the IStrategy interface and consists of three main methods: populate_indicators, populate_buy_trend, and populate_sell_trend. In the populate_indicators method, the strategy calculates various technical indicators based on the provided input data, such as moving averages, Bollinger Bands, and momentum indicators.
It also prepares additional information for trades, such as the rate of change (ROC), average true range (ATR), and trend direction indicators.
The populate_buy_trend method determines the conditions for entering a buy trade based on the calculated indicators.
It checks for specific criteria, including the relationship between the closing price and the smoothed Heikin Ashi low, the crossover of moving averages, Bollinger Bands' expansion, and other factors related to stochastic indicators and volume. The populate_sell_trend method defines the conditions for exiting a buy trade and entering a sell trade. It checks for criteria such as the relationship between the closing price and the smoothed Heikin Ashi high, the reversal of moving averages, overbought conditions indicated by momentum and volume indicators, and more. Additionally, the strategy includes a custom stop-loss mechanism that assesses the current profitability of a trade and decides whether to close it based on predefined thresholds related to rate of change (ROC) and trade duration. The strategy also incorporates functionality for calculating the return on investment (ROI) dynamically. It determines the minimal ROI and table ROI based on the trade duration and considers additional trend-related indicators such as RMI (Relative Momentum Index), SSL (Squeeze Momentum Indicator), and candlestick patterns to adjust the ROI values. Overall, the CryptoFrog strategy utilizes technical indicators and predefined criteria to generate buy and sell signals for cryptocurrency trading.
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: 1717250460000000000
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 14:01: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 14:01: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/Discord_3_CryptoFrog.py", line 393, in custom_stoploss
sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
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, 14, 1, tzinfo=datetime.timezone.utc)