This strategy utilizes an improved RSI indicator developed by John Ehlers, which uses special smoothing techniques to reduce lag and generate more reliable trading signals. The strategy allows easy switching between long and short directions in the input settings.
The strategy first calculates a smoothed price, which is the average of the current closing price and previous 3 days’ closing prices. Then it calculates the upward and downward momentum of this smoothed price, and normalizes them into a 0-1 RSI value. Finally a RSI above 0.5 generates a long signal, while a RSI below 0.5 generates a short signal.
The core of this strategy lies in the improved calculation of the RSI indicator. The traditional RSI only looks at price change over a single period, which causes increasing lag as the period parameter rises. Ehlers’ idea is to consider the price trend over multiple periods, and take a weighted average, so as to smooth out short-term price noises while reducing lag.
Specifically, rather than simply looking at the rise/fall ratio, this strategy calculates the upward and downward momentum of the smoothed price. The RSI is then normalized to the 0-1 range. This better reflects the price trend and generates more reliable trading signals.
Compared to the traditional RSI indicator, this strategy has the following advantages owing to the improved smoothed RSI:
In summary, this strategy combines the merits of RSI while improving upon its weaknesses like lag and smoothing. This allows us to take advantage of the more powerful and reliable RSI signals, while reducing market noise and timely capturing trend changes.
Despite the beneficial improvements made to the RSI, some risks remain:
Suggested ways to reduce risks:
This strategy can be further improved in the following aspects:
With continuous optimizations on parameters, filters, combinations, this strategy can be made into a more powerful, reliable, trend-aware RSI trading system, significantly improving win rate and profitability.
This strategy achieves better smoothing and reduced lag by improving RSI calculation, effectively smoothing price changes and timely capturing trend shifts. The advantages mainly lie in smoothing price action and catching trend turns. Risks remain and continuous optimizations can further improve the strategy. Overall, it provides new ideas on applying RSI, and brings more value to our trading decisions.
/*backtest start: 2022-09-19 00:00:00 end: 2023-09-25 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=2 //////////////////////////////////////////////////////////// // Copyright by HPotter v1.0 16/11/2017 // This is new version of RSI oscillator indicator, developed by John Ehlers. // The main advantage of his way of enhancing the RSI indicator is smoothing // with minimum of lag penalty. // // You can change long to short in the Input Settings // WARNING: // - For purpose educate only // - This script to change bars colors. //////////////////////////////////////////////////////////// strategy(title="Smoothed RSI") Length = input(10, minval=1) reverse = input(false, title="Trade reverse") xValue = (close + 2 * close[1] + 2 * close[2] + close[3] ) / 6 CU23 = sum(iff(xValue > xValue[1], xValue - xValue[1], 0), Length) CD23 = sum(iff(xValue < xValue[1], xValue[1] - xValue, 0), Length) nRes = iff(CU23 + CD23 != 0, CU23/(CU23 + CD23), 0) pos = iff(nRes == 0, -1, iff(nRes == 1, 1, nz(pos[1], 0))) possig = iff(reverse and pos == 1, -1, iff(reverse and pos == -1, 1, pos)) if (possig == 1) strategy.entry("Long", strategy.long) if (possig == -1) strategy.entry("Short", strategy.short) barcolor(possig == -1 ? red: possig == 1 ? green : blue ) plot(nRes, color=blue, title="Smoothed RSI")