This strategy is a quantitative trading system that combines G-Channel and Exponential Moving Average (EMA). The core concept is to capture market trend directions through G-Channel while using EMA for signal confirmation and risk control, aiming to generate profits from market fluctuations. The strategy operates in a fully automated mode without manual intervention.
The strategy operates based on two core indicators: G-Channel and EMA. G-Channel identifies price trends by dynamically calculating upper and lower bands, generating trading signals when prices break through the channel. Specifically, the strategy uses a 100-period G-Channel calculation, continuously updating the channel boundaries through mathematical formulas. Additionally, a 50-period EMA is introduced as secondary confirmation, executing trades only when the price’s relative position to EMA meets expectations. Buy conditions are triggered when G-Channel signals long and closing price is below EMA, while sell conditions occur when G-Channel signals short and closing price is above EMA.
This strategy constructs a robust quantitative trading system by combining G-Channel and EMA technical indicators. The strategy logic is clear, implementation is simple, and it offers good scalability. Through proper parameter optimization and risk control measures, the strategy shows potential for generating stable returns in live trading. It is recommended to optimize the strategy based on market characteristics and strictly implement risk management protocols when applying it to live trading.
/*backtest start: 2019-12-23 08:00:00 end: 2024-12-18 08:00:00 period: 1d basePeriod: 1d 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/ // © stanleygao01 //@version=5 strategy('G-Channel with EMA Strategy', overlay=true) // G-Channel parameters length = input(100, title='G-Channel Length') src = input(close, title='Source') a = 0.0 b = 0.0 a := math.max(src, nz(a[1])) - nz(a[1] - b[1]) / length b := math.min(src, nz(b[1])) + nz(a[1] - b[1]) / length avg = math.avg(a, b) crossup = b[1] < close[1] and b > close crossdn = a[1] < close[1] and a > close bullish = ta.barssince(crossdn) <= ta.barssince(crossup) // EMA parameters emaLength = input(50, title='EMA Length') ema = ta.ema(close, emaLength) // Buy and Sell Conditions buyCondition = bullish and close < ema sellCondition = not bullish and close > ema // Plot G-Channel c = bullish ? color.lime : color.red p1 = plot(avg, title='Average', color=c, linewidth=1, transp=90) p2 = plot(close, title='Close Price', color=c, linewidth=1, transp=100) fill(p1, p2, color=c, transp=90) // Plot EMA plot(ema, title='EMA', color=color.new(color.blue, 0), linewidth=2) // Strategy Entries and Exits if buyCondition strategy.entry('Buy', strategy.long) if sellCondition strategy.close('Buy') // Plot Buy/Sell Labels plotshape(buyCondition, title='Buy Signal', location=location.belowbar, color=color.new(color.lime, 0), style=shape.labelup, text='Buy') plotshape(sellCondition, title='Sell Signal', location=location.abovebar, color=color.new(color.red, 0), style=shape.labeldown, text='Sell')