该策略基于三连阳/阴形态和双均线系统,通过判断三根连续K线的实体大小变化和均线系统的交叉信号,在第三根K线收盘时产生买入或卖出信号,以捕捉潜在的趋势拐点和价格反转机会。
该策略的核心在于通过三连阳/阴形态捕捉趋势启动点,同时利用双均线系统验证趋势强度和方向,两个维度相结合,力求在趋势初期有效入场,降低逆势交易风险。
该策略通过经典的三连阳/阴形态和双均线系统相结合,力求捕捉趋势起始点,博取趋势之初的潜在价差收益。其优势在于信号明确,逻辑简单,易于实现和优化;同时也存在频繁交易、信号不稳定、风险控制不足等潜在风险和改进空间。后续可从信号过滤、仓位管理、止盈止损等方面入手,不断丰富和强化该策略的综合表现,为量化交易实践提供更多参考。
/*backtest start: 2023-03-22 00:00:00 end: 2024-03-27 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=4 strategy("Consecutive Candles with MAs", shorttitle="CCMAs", overlay=true) // Üç ardışık mumun büyüklüklerinin arttığını kontrol eden fonksiyon isThreeConsecutiveCandlesIncreasing() => firstCandleBody = abs(close[2] - open[2]) secondCandleBody = abs(close[1] - open[1]) thirdCandleBody = abs(close - open) firstCandleBody < secondCandleBody and secondCandleBody < thirdCandleBody // Üçüncü mum kapandığında al veya sat koşulu longCondition = isThreeConsecutiveCandlesIncreasing() and close > open shortCondition = isThreeConsecutiveCandlesIncreasing() and close < open // 50 ve 200 periyotluk hareketli ortalamalar ma50 = sma(close, 50) ma200 = sma(close, 200) // Al veya sat sinyallerini grafiğe ekleme plotshape(series=longCondition, title="Al Sinyali", location=location.belowbar, color=color.green, style=shape.triangleup, text="AL") plotshape(series=shortCondition, title="Sat Sinyali", location=location.abovebar, color=color.red, style=shape.triangledown, text="SAT") // Hareketli ortalamaların grafiğe eklenmesi plot(ma50, title="50 Periyotluk Hareketli Ortalama", color=color.blue) plot(ma200, title="200 Periyotluk Hareketli Ortalama", color=color.red) // Al veya sat komutlarını çalıştırma if (longCondition) strategy.entry("Al", strategy.long) if (shortCondition) strategy.entry("Sat", strategy.short)