This strategy generates buy and sell signals using the Laguerre RSI indicator and filters the signals using the ADX indicator. When the Laguerre RSI crosses above or below predefined buy and sell levels, and the ADX is above a set threshold, the strategy produces buy or sell signals. This approach of combining a fast and a slow indicator allows for timely capture of trading opportunities when the trend strength is sufficient while avoiding trading when the trend is unclear.
The Laguerre RSI is a momentum indicator used to measure the speed and strength of price changes. It is based on the Laguerre filter and is more responsive to price changes compared to the traditional RSI. The strategy generates signals by comparing the Laguerre RSI with predefined buy and sell levels.
The ADX indicator measures the strength of a price trend, with higher values indicating a stronger trend. The strategy sets an ADX threshold to enter trades only when the trend strength is sufficient and to stay on the sidelines when the trend is not clear. This helps to improve the reliability of the signals and avoid frequent trading.
The strategy uses crossovers of the Laguerre RSI to trigger buy and sell signals. It enters a long position when the indicator crosses above the buy level and a short position when it crosses below the sell level. At the same time, the ADX must be above the preset threshold to confirm the trend strength. This dual-condition design aims to capture trading opportunities in strong trends.
The Laguerre RSI with ADX filtered trading strategy is a trend-following approach. It utilizes a fast indicator to capture price changes while confirming trend strength with a slow indicator. This combination allows for timely trading when the trend is clear while staying on the sidelines when the trend is uncertain. The strategy’s advantages lie in its simplicity and wide applicability, but it also has issues such as frequent trading and insufficient risk control. Future enhancements can focus on signal optimization, risk management improvements, and position sizing to achieve more robust returns.
/*backtest start: 2023-05-11 00:00:00 end: 2024-05-16 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy('Laguerre RSI with Buy/Sell Signals and ADX Filter', shorttitle='LaRSI_ADX Signals', overlay=false) // Kullanıcı girdileri src = input(title='Source', defval=close) alpha = input.float(title='Alpha', minval=0, maxval=1, step=0.1, defval=0.2) buyLevel = input(20, title='Buy Level') sellLevel = input(80, title='Sell Level') adxLength = input(14, title='ADX Length') adxSmoothing = input(14, title='ADX Smoothing') adxLevel = input(20, title='ADX Level') // adxLevel tanımlamasını ekledik // ADX hesaplaması [diPlus, diMinus, adx] = ta.dmi(adxLength, adxSmoothing) // Laguerre RSI hesaplamaları gamma = 1 - alpha L0 = 0.0 L0 := (1 - gamma) * src + gamma * nz(L0[1]) L1 = 0.0 L1 := -gamma * L0 + nz(L0[1]) + gamma * nz(L1[1]) L2 = 0.0 L2 := -gamma * L1 + nz(L1[1]) + gamma * nz(L2[1]) L3 = 0.0 L3 := -gamma * L2 + nz(L2[1]) + gamma * nz(L3[1]) cu = (L0 > L1 ? L0 - L1 : 0) + (L1 > L2 ? L1 - L2 : 0) + (L2 > L3 ? L2 - L3 : 0) cd = (L0 < L1 ? L1 - L0 : 0) + (L1 < L2 ? L2 - L1 : 0) + (L2 < L3 ? L3 - L2 : 0) temp = cu + cd == 0 ? -1 : cu + cd LaRSI = temp == -1 ? 0 : cu / temp // Alım ve satım sinyalleri longCondition = ta.crossover(100 * LaRSI, buyLevel) and adx > adxLevel shortCondition = ta.crossunder(100 * LaRSI, sellLevel) and adx > adxLevel // Strateji giriş ve çıkışları strategy.entry('Long', strategy.long, when=longCondition) strategy.entry('Short', strategy.short, when=shortCondition) // Göstergeleri çizme plot(100 * LaRSI, title='LaRSI', linewidth=2, color=color.new(color.blue, 0)) hline(buyLevel, title='Buy Level', color=color.new(color.green, 0), linestyle=hline.style_dotted) hline(sellLevel, title='Sell Level', color=color.new(color.red, 0), linestyle=hline.style_dotted) plot(adx, title='ADX', color=color.new(color.orange, 0))