This strategy is based on the pattern of three consecutive bullish/bearish candles and a dual moving average system. By judging the change in body size of three consecutive candles and the crossover signals of the moving average system, it generates buy or sell signals at the close of the third candle to capture potential trend turning points and price reversal opportunities.
The core of this strategy lies in capturing the starting point of a trend through the three consecutive bullish/bearish candle pattern, while using the dual moving average system to verify trend strength and direction. The combination of these two dimensions aims to effectively enter positions at the beginning of a trend and reduce the risk of counter-trend trading.
By combining the classic three consecutive bullish/bearish candle pattern with a dual moving average system, this strategy aims to capture the starting point of a trend and profit from potential price spreads at the beginning of the trend. Its advantages lie in clear signals, simple logic, and ease of implementation and optimization; at the same time, it also has potential risks and room for improvement, such as frequent trading, unstable signals, and insufficient risk control. In the future, we can start from aspects like signal filtering, position management, take-profit/stop-loss, etc., to continuously enrich and strengthen the overall performance of this strategy and provide more references for quantitative trading practice.
/*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)template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6