WaveTrend Cross LazyBear策略是一个基于WaveTrend指标的交易策略。该策略使用两条不同周期的WaveTrend指标线,当较快周期的WaveTrend指标线上穿较慢周期的WaveTrend指标线时产生买入信号,当较快周期的WaveTrend指标线下穿较慢周期的WaveTrend指标线时产生卖出信号。该策略还设置了超买和超卖区域,用于辅助判断市场状态。
该策略的核心是WaveTrend指标,该指标由以下步骤计算得出:
该策略使用两条不同周期(默认为10和21)的WaveTrend指标线,分别记为WT1和WT2。当WT1上穿WT2时,产生买入信号;当WT1下穿WT2时,产生卖出信号。此外,该策略还设置了4个辅助判断的水平:超买水平1、超买水平2、超卖水平1和超卖水平2,用于辅助判断市场状态。
WaveTrend Cross LazyBear策略是一个基于WaveTrend指标的趋势追踪策略,通过双重周期的指标设计和超买超卖水平的辅助判断,在捕捉趋势的同时也兼顾了一定的风险控制。但是,该策略在震荡市中可能出现较多假信号,且缺乏严格的风险管理措施,实际应用中还需要进一步的优化和改进。
/*backtest start: 2024-03-01 00:00:00 end: 2024-03-31 23:59:59 period: 1h basePeriod: 15m 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/ // © burakaydingr //@version=5 strategy("WaveTrend with Crosses [LazyBear]", shorttitle="WT_CROSS_LB", overlay=true) // Kullanıcı girişleri n1 = input(10, title="Channel Length") n2 = input(21, title="Average Length") obLevel1 = input(60, title="Over Bought Level 1") obLevel2 = input(53, title="Over Bought Level 2") osLevel1 = input(-60, title="Over Sold Level 1") osLevel2 = input(-53, title="Over Sold Level 2") // Temel hesaplamalar ap = hlc3 esa = ta.ema(ap, n1) d = ta.ema(math.abs(ap - esa), n1) ci = (ap - esa) / (0.015 * d) tci = ta.ema(ci, n2) // WaveTrend göstergeleri wt1 = tci wt2 = ta.sma(wt1, 4) // Al ve Sat Sinyalleri buySignal = ta.crossover(wt1, wt2) sellSignal = ta.crossunder(wt1, wt2) // Alım ve Satım pozisyonları if (buySignal) if (strategy.position_size <= 0) // Eğer şu anda açık bir satış pozisyonu varsa, onu kapat strategy.close("Sell") strategy.entry("Buy", strategy.long, comment="Buy Signal: Price crossed above WT2") if (sellSignal) if (strategy.position_size >= 0) // Eğer şu anda açık bir alım pozisyonu varsa, onu kapat strategy.close("Buy") strategy.entry("Sell", strategy.short, comment="Sell Signal: Price crossed below WT2") // Renkler ve diğer görseller plot(0, color=color.new(color.gray, 0), title="Zero Level") plot(obLevel1, color=color.new(color.red, 0), title="Overbought Level 1") plot(osLevel1, color=color.new(color.green, 0), title="Oversold Level 1") plot(obLevel2, color=color.new(color.purple, 0), title="Overbought Level 2") plot(osLevel2, color=color.new(color.orange, 0), title="Oversold Level 2") plot(wt1, color=color.new(color.red, 0), title="WT1") plot(wt2, color=color.new(color.blue, 0), title="WT2") plot(wt1-wt2, color=color.new(color.purple, 80), style=plot.style_area, title="WT1-WT2 Area") // İşaretler plotshape(buySignal, location=location.absolute, color=color.new(color.yellow, 0), style=shape.circle, size=size.small, title="Buy Signal") plotshape(sellSignal, location=location.absolute, color=color.new(color.red, 0), style=shape.circle, size=size.small, title="Sell Signal")