
This strategy is a technical analysis trading system that combines the Gaussian Channel and Stochastic RSI indicators. The Gaussian Channel forms dynamic support and resistance levels using exponential moving average (EMA) and standard deviation multiplier, while the Stochastic RSI smooths RSI values to generate %K and %D lines for confirming potential reversals. The strategy is applicable to any timeframe and provides traders with a systematic trading approach.
The core logic of the strategy is based on the following key elements: 1. Gaussian Channel Construction: Uses EMA as the basis line and creates upper and lower channels through standard deviation multiplier. The upper channel serves as dynamic resistance while the lower channel acts as dynamic support. 2. Stochastic RSI Signals: Calculates traditional RSI and then applies stochastic treatment to generate smoother %K and %D lines. 3. Trade Signal Generation: Long signals are generated when price breaks below the lower channel and the Stochastic RSI %K line crosses above the %D line; positions are closed when price breaks above the upper channel. 4. Time Filtering: Strategy includes a customizable date range filter allowing backtesting or trading within specific time periods.
This strategy builds a trading system combining trend following and reversal capture capabilities through the integration of Gaussian Channel and Stochastic RSI. The strategy design considers multiple technical analysis dimensions, with solid theoretical foundation and practical feasibility. Through proper parameter optimization and risk management, the strategy has the potential to achieve stable performance across various market environments. However, users need to fully understand the strategy’s advantages and limitations, making targeted adjustments based on actual trading conditions.
/*backtest
start: 2024-02-18 00:00:00
end: 2025-02-16 08:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © fgkkaraca
//@version=5
strategy("Alienseeker GC and RSI Strategy", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=0, default_qty_type=strategy.percent_of_equity, default_qty_value=200, process_orders_on_close=true)
// Gaussian Channel Inputs
lengthGC = input.int(20, "Gaussian Channel Length", minval=1)
multiplier = input.float(2.0, "Standard Deviation Multiplier", minval=0.1)
// Calculate Gaussian Channel
basis = ta.ema(close, lengthGC)
deviation = multiplier * ta.stdev(close, lengthGC)
upperChannel = basis + deviation
lowerChannel = basis - deviation
// Plot Gaussian Channel
plot(basis, "Basis", color=color.blue)
plot(upperChannel, "Upper Channel", color=color.green)
plot(lowerChannel, "Lower Channel", color=color.red)
// Stochastic RSI Inputs
rsiLength = input.int(14, "RSI Length", minval=1)
stochLength = input.int(14, "Stochastic Length", minval=1)
smoothK = input.int(3, "Smooth K", minval=1)
smoothD = input.int(3, "Smooth D", minval=1)
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Calculate Stochastic RSI
lowestRSI = ta.lowest(rsi, stochLength)
highestRSI = ta.highest(rsi, stochLength)
stochRSI = (rsi - lowestRSI) / (highestRSI - lowestRSI) * 100
k = ta.sma(stochRSI, smoothK)
d = ta.sma(k, smoothD)
// Trading Conditions
stochUp = k > d
priceAboveUpper = ta.crossover(close, upperChannel)
priceBelowUpper = ta.crossunder(close, lowerChannel)
// Date Range Filter
startDate = input(timestamp("2018-01-01"), "Start Date")
endDate = input(timestamp("2069-01-01"), "End Date")
timeInRange = true
// Strategy Execution
if timeInRange
strategy.entry("Long", strategy.long, when=priceBelowUpper and stochUp)
strategy.close("Long", when=priceAboveUpper )