// Indicators ema = ta.ema(close, emaLength) rsi = ta.rsi(close, rsiLength)
// 1. BULLISH PATTERN (Double Bottom + Retest) // ------------------------------------------- var float necklineBullish = na var bool breakoutBullish = false
// Detect Double Bottom (two lows with a peak in between) swingLow = ta.lowest(low, 5) swingLowPrev = ta.lowest(low, 5)[5] swingHighBetween = ta.highest(high, 5) isDoubleBottom = swingLow >= swingLowPrev * 0.99 and swingLow <= swingLowPrev * 1.01 and swingHighBetween > swingLow and swingHighBetween > swingLowPrev
// Update neckline on pattern detection if isDoubleBottom necklineBullish := swingHighBetween breakoutBullish := false
// Check breakout above neckline if not breakoutBullish and close > necklineBullish breakoutBullish := true
// Retest after breakout (price returns to neckline and bounces) retestBullish = breakoutBullish and low <= necklineBullish and close > necklineBullish and rsi < oversold
// 2. BEARISH PATTERN (Double Top + Retest) // ------------------------------------------- var float necklineBearish = na var bool breakoutBearish = false
// Detect Double Top (two highs with a trough in between) swingHigh = ta.highest(high, 5) swingHighPrev = ta.highest(high, 5)[5] swingLowBetween = ta.lowest(low, 5) isDoubleTop = swingHigh <= swingHighPrev * 1.01 and swingHigh >= swingHighPrev * 0.99 and swingLowBetween < swingHigh and swingLowBetween < swingHighPrev
// Update neckline on pattern detection if isDoubleTop necklineBearish := swingLowBetween breakoutBearish := false
// Check breakout below neckline if not breakoutBearish and close < necklineBearish breakoutBearish := true
// Retest after breakout (price returns to neckline and rejects) retestBearish = breakoutBearish and high >= necklineBearish and close < necklineBearish and rsi > overbought
// 3. EMA + RSI Conditions // ----------------------- emaBuy = ta.crossover(close, ema) and rsi < oversold emaSell = ta.crossunder(close, ema) and rsi > overbought
// Final Buy/Sell Signals (Combine Retest & EMA/RSI) buySignal = retestBullish or emaBuy sellSignal = retestBearish or emaSell
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menerbitkannya sebagai sumber terbuka, sehingga para trader dapat memahami dan memverifikasinya. Hormat untuk penulisnya! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.