The stochrsi3 strategy is a trading strategy implemented in Python for backtesting purposes. Here is a short description of what the strategy does:
The strategy uses the Stochastic RSI (Relative Strength Index) indicator along with exponential moving averages (EMA) and the Average True Range (ATR) indicator. It operates on the 1-hour timeframe and uses the same timeframe for informative data.
The strategy calculates various indicators such as EMA, ATR, and Stochastic RSI for both the main and informative dataframes.
It defines a minimal return on investment (ROI) of 1, meaning that it aims to achieve at least a 1% return on each trade.
It sets a stop loss at -30%, meaning that if a trade's profit reaches -30%, it will be stopped out. The strategy does not use trailing stop loss. It uses limit orders for both buying and selling. The strategy plots the EMA indicators (EMA_8, EMA_50, EMA_15) on the main plot and the ATR indicator on a subplot. It defines a custom stop loss based on the ATR indicator. For the buy signal, the strategy looks for conditions where EMA_15 is greater than EMA_50, EMA_8 is greater than EMA_15, the closing price is greater than EMA_8, and there is a cross above signal in the Stochastic RSI indicator. For the sell signal, the strategy looks for conditions where EMA_15 is less than EMA_50 or EMA_8 is less than EMA_15. The strategy checks if the current profit of a trade has reached a minimum ROI, taking into account the trade duration and the ROI value from a custom trade info dataframe. That's a brief overview of what the stochrsi3 strategy does. It uses technical indicators to generate buy and sell signals and implements risk management through stop loss and minimum ROI conditions.
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 1335, in backtest_one_strategy
results = self.backtest(
^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/optimize/backtesting.py", line 1270, in backtest
open_trade_count_start = self.backtest_loop(
^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/optimize/backtesting.py", line 1175, in backtest_loop
self._check_trade_exit(trade, row, current_time) # Place exit order if necessary
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/optimize/backtesting.py", line 736, in _check_trade_exit
exits = self.strategy.should_exit(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/strategy/interface.py", line 1153, in should_exit
and self.min_roi_reached(trade=trade, current_profit=current_profit_best,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/user_data/strategies/Discord_stochrsi3.py", line 129, in min_roi_reached
_, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/user_data/strategies/Discord_stochrsi3.py", line 144, in min_roi_reached_dynamic
open_date_mask = custom_info_pair.index.unique().get_loc(open_date, method='ffill')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DatetimeIndex.get_loc() got an unexpected keyword argument 'method'