This strategy combines the pivot point reversal strategy with the Relative Strength Index (RSI) indicator to detect potential trend reversal opportunities at pivot levels by checking RSI signals.
The strategy first calculates the key support and resistance levels by looking left and right over a number of bars to find the highest high pivot and lowest low pivot. When a pivot level is established, it further checks if RSI meets overbought or oversold conditions. Specifically, if RSI is below oversold line at resistance, it is considered oversold for long entry. If RSI is above overbought line at support, it is considered overbought for short entry. This allows using RSI to filter false breakouts and identify better entry timing at trend reversal points.
The code details are as follows:
The main advantages of this strategy are:
Trend confirmation: RSI filters false breakouts and avoids wrong entries during temporary pullbacks.
Risk control: Stops are placed near key supports and resistances for better risk management.
Versatility: Applicable to different products and timeframes.
Simplicity: Minimal indicators and parameters for easy implementation.
Data efficiency: Only OHLC data needed and not sensitive to data quality.
The potential risks are:
Pivot failure risk: Key levels may be broken during huge market swings, causing strategy failure. This can be mitigated by adjusting lookback periods to widen pivot ranges.
RSI divergence risk: RSI may diverge and become ineffective for overbought/oversold in choppy markets. RSI parameters can be tuned and additional filters added to validate RSI signals.
Stop loss risk: Stops can be hit during strong trends leading to increased losses. Wider stop loss distances could help but require balancing profits and risks.
Drawdown risk: The strategy is executed on every tick and can face drawdowns during unfavorable reversals. Drawdowns can be controlled via risk management.
The strategy can be improved in several aspects:
Optimize pivot calculation by testing different left/right lookback periods and adding filters to improve accuracy.
Optimize RSI parameters for better overbought/oversold detection. Test different lengths and threshold levels.
Add additional filters to avoid whipsaws in choppy markets, such as volatility indicators.
Optimize stops to balance profits and risks. Consider trailing stops and other dynamic mechanisms.
Employ statistical stops based on historical data analysis to determine stop loss ranges.
Add multi-timeframe confirmation to improve win rate using multiple periods.
The Go With The Trend RSI strategy combines pivot points and RSI to identify potential trend turning points and find optimal entries. Compared to using single techniques like pivot or RSI alone, this strategy improves robustness and consistency. Further optimizations on parameters and filters can enhance win rate and risk-adjusted returns. Overall, it is a practical system to trade short-term trend reversals.
/*backtest start: 2023-09-30 00:00:00 end: 2023-10-07 00:00:00 period: 45m basePeriod: 5m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=4 strategy("Pivot Point Reversal + RSI Strategy", shorttitle = 'PP + RSI Strategy', overlay=true) //////////// // Inputs // leftBars = input(3, title = 'PP - Left Bars') rightBars = input(3, title = 'PP - Right Bars') rsi_length = input(14, title = "RSI - Length") rsi_long = input(70, title = "RSI - Overbought level") rsi_short = input(30, title = "RSI - Overold level") ////////////////// // Calculations // // Pivot Points swh = pivothigh(leftBars, rightBars) swl = pivotlow(leftBars, rightBars) // Pivot High swh_cond = not na(swh) hprice = 0.0 hprice := swh_cond ? swh : hprice[1] le = false le := swh_cond ? true : (le[1] and high > hprice ? false : le[1]) // Pivot Low swl_cond = not na(swl) lprice = 0.0 lprice := swl_cond ? swl : lprice[1] se = false se := swl_cond ? true : (se[1] and low < lprice ? false : se[1]) // RSI rsi = rsi(close, 14) ////////////// // STRATEGY // if (le and rsi[rightBars] < rsi_long ) strategy.entry("PivRevLE", strategy.long, comment = "PivRSI Long", stop = hprice + syminfo.mintick) if (se and rsi[rightBars] > rsi_short) strategy.entry("PivRevSE", strategy.short, comment = "PivRSI Short", stop = lprice - syminfo.mintick)