The TaSearch30m strategy is a trading strategy that uses technical analysis indicators to generate buy and sell signals for 30-minute timeframes. Here's a breakdown of how it works:
The strategy uses the TaSearch class from the taSearch module to perform technical analysis calculations and find extremes in the price data. In the populate_indicators method, the strategy populates the indicators based on the provided DataFrame, including finding extremes.
It then applies the logic to generate buy and sell signals for each row in the DataFrame using the __populate_buy and __populate_sell methods.
The populate_buy_trend and populate_sell_trend methods update the DataFrame to mark the rows where a buy or sell signal is generated with the value 1.
The confirm_trade_exit method is responsible for confirming whether a trade should be exited. In this case, if the exit reason is an exit signal and the calculated profit ratio of the trade is negative, the trade is rejected. The __populate_buy method implements the conditions for generating a buy signal. It checks if the minimum price percentage is below a threshold (-self.p), the 7-day relative strength index (RSI) is below 15, and the MACD (Moving Average Convergence Divergence) indicators are negative. The __populate_sell method implements the conditions for generating a sell signal. It checks if the 7-day RSI is above 85 and the MACD indicators are positive. By backtesting this strategy on historical price data, you can evaluate its performance and determine its effectiveness in generating profitable trading signals.