OPEN-SOURCE SCRIPT
Multi-Reversal + MA50/200 + MACD + BJ (Tilson) Combo

//version=5
indicator(title="Multi-Reversal + MA50/200 + MACD + BJ (Tilson) Combo", overlay=true)
// --- Moving Averages (MA50, MA200) ---
ma_50 = ta.sma(close, 50)
ma_200 = ta.sma(close, 200)
plot(ma_50, color=color.blue, linewidth=1, title="MA50")
plot(ma_200, color=color.red, linewidth=2, title="MA200")
// --- MACD ---
fast_length = input(12, title="MACD Fast")
slow_length = input(26, title="MACD Slow")
signal_length = input(9, title="MACD Signal")
[macdLine, signalLine, _] = ta.macd(close, fast_length, slow_length, signal_length)
macd_cross_up = ta.crossover(macdLine, signalLine)
macd_cross_down = ta.crossunder(macdLine, signalLine)
// --- Tilson MA (BJ reversal) ---
tilson_length = input(20, title="Tilson MA Length (BJ reversal)")
tilson_ma = ta.ema(ta.ema(close, tilson_length), tilson_length)
bj_cross_up = close > tilson_ma and close[1] < tilson_ma[1]
bj_cross_down = close < tilson_ma and close[1] > tilson_ma[1]
plot(tilson_ma, color=color.orange, linewidth=2, title="Tilson MA (BJ reversal)")
// --- Đảo chiều tổng hợp ---
bull_reversal = macd_cross_up and bj_cross_up and close > ma_50 and close > ma_200
bear_reversal = macd_cross_down and bj_cross_down and close < ma_50 and close < ma_200
// --- Plot tín hiệu trên chart ---
plotshape(bull_reversal, location=location.belowbar, style=shape.triangleup, size=size.large, color=color.lime, title="Bullish Reversal", text="STRONG UP")
plotshape(bear_reversal, location=location.abovebar, style=shape.triangledown, size=size.large, color=color.red, title="Bearish Reversal", text="STRONG DN")
// --- BJ riêng lẻ ---
plotshape(bj_cross_up, location=location.belowbar, color=color.yellow, style=shape.circle, size=size.tiny, title="BJ Up Only")
plotshape(bj_cross_down, location=location.abovebar, color=color.yellow, style=shape.circle, size=size.tiny, title="BJ Down Only")
// --- Alert conditions ---
alertcondition(bull_reversal, title="Bullish Strong Reversal", message="Buy opportunity: MA bullish + MACD + BJ reversal!")
alertcondition(bear_reversal, title="Bearish Strong Reversal", message="Sell warning: MA bearish + MACD + BJ reversal!")
indicator(title="Multi-Reversal + MA50/200 + MACD + BJ (Tilson) Combo", overlay=true)
// --- Moving Averages (MA50, MA200) ---
ma_50 = ta.sma(close, 50)
ma_200 = ta.sma(close, 200)
plot(ma_50, color=color.blue, linewidth=1, title="MA50")
plot(ma_200, color=color.red, linewidth=2, title="MA200")
// --- MACD ---
fast_length = input(12, title="MACD Fast")
slow_length = input(26, title="MACD Slow")
signal_length = input(9, title="MACD Signal")
[macdLine, signalLine, _] = ta.macd(close, fast_length, slow_length, signal_length)
macd_cross_up = ta.crossover(macdLine, signalLine)
macd_cross_down = ta.crossunder(macdLine, signalLine)
// --- Tilson MA (BJ reversal) ---
tilson_length = input(20, title="Tilson MA Length (BJ reversal)")
tilson_ma = ta.ema(ta.ema(close, tilson_length), tilson_length)
bj_cross_up = close > tilson_ma and close[1] < tilson_ma[1]
bj_cross_down = close < tilson_ma and close[1] > tilson_ma[1]
plot(tilson_ma, color=color.orange, linewidth=2, title="Tilson MA (BJ reversal)")
// --- Đảo chiều tổng hợp ---
bull_reversal = macd_cross_up and bj_cross_up and close > ma_50 and close > ma_200
bear_reversal = macd_cross_down and bj_cross_down and close < ma_50 and close < ma_200
// --- Plot tín hiệu trên chart ---
plotshape(bull_reversal, location=location.belowbar, style=shape.triangleup, size=size.large, color=color.lime, title="Bullish Reversal", text="STRONG UP")
plotshape(bear_reversal, location=location.abovebar, style=shape.triangledown, size=size.large, color=color.red, title="Bearish Reversal", text="STRONG DN")
// --- BJ riêng lẻ ---
plotshape(bj_cross_up, location=location.belowbar, color=color.yellow, style=shape.circle, size=size.tiny, title="BJ Up Only")
plotshape(bj_cross_down, location=location.abovebar, color=color.yellow, style=shape.circle, size=size.tiny, title="BJ Down Only")
// --- Alert conditions ---
alertcondition(bull_reversal, title="Bullish Strong Reversal", message="Buy opportunity: MA bullish + MACD + BJ reversal!")
alertcondition(bear_reversal, title="Bearish Strong Reversal", message="Sell warning: MA bearish + MACD + BJ reversal!")
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.