PROTECTED SOURCE SCRIPT
WMTrades SMT + PSP

//version=5
indicator("WM SMT + PSP PRO", overlay=true, max_lines_count=500)
// ===== INPUTS =====
symbol1 = input.symbol("NQ1!", "Ativo 1")
symbol2 = input.symbol("ES1!", "Ativo 2")
symbol3 = input.symbol("YM1!", "Ativo 3")
useCustomTF = input.bool(false, "Usar timeframe personalizado?")
customTF = input.timeframe("60", "Timeframe personalizado")
useClosedBar = input.bool(true, "Apenas barra fechada?")
barsBack = input.int(100, "Plotar divergências das últimas X barras", minval=1)
// ===== TIMEFRAME =====
tf = useCustomTF ? customTF : timeframe.period
// ===== DADOS SMT =====
h1 = request.security(symbol1, tf, high)
l1 = request.security(symbol1, tf, low)
h2 = request.security(symbol2, tf, high)
l2 = request.security(symbol2, tf, low)
h3 = request.security(symbol3, tf, high)
l3 = request.security(symbol3, tf, low)
// ===== DADOS PSP =====
o1 = request.security(symbol1, tf, open)
c1 = request.security(symbol1, tf, close)
o2 = request.security(symbol2, tf, open)
c2 = request.security(symbol2, tf, close)
o3 = request.security(symbol3, tf, open)
c3 = request.security(symbol3, tf, close)
// ================= SMT =================
rh1 = h1[1]
rl1 = l1[1]
rh2 = h2[1]
rl2 = l2[1]
rh3 = h3[1]
rl3 = l3[1]
bH1 = h1 > rh1
bH2 = h2 > rh2
bH3 = h3 > rh3
bL1 = l1 < rl1
bL2 = l2 < rl2
bL3 = l3 < rl3
bearishSMT = (bH1 or bH2 or bH3) and not (bH1 and bH2 and bH3)
bullishSMT = (bL1 or bL2 or bL3) and not (bL1 and bL2 and bL3)
finalBearSMT = useClosedBar ? bearishSMT and barstate.isconfirmed : bearishSMT
finalBullSMT = useClosedBar ? bullishSMT and barstate.isconfirmed : bullishSMT
// ================= PSP =================
bull1 = c1 > o1
bull2 = c2 > o2
bull3 = c3 > o3
bear1 = c1 < o1
bear2 = c2 < o2
bear3 = c3 < o3
psp = (bull1 or bull2 or bull3) and (bear1 or bear2 or bear3)
finalPSP = useClosedBar ? psp and barstate.isconfirmed : psp
// ===== CONTROLE HISTÓRICO =====
plotAllowed = bar_index >= (bar_index - barsBack)
// ===== SMT DESENHO =====
darkBlue = color.rgb(0, 0, 139)
if finalBearSMT and plotAllowed
line.new(bar_index[1], high[1], bar_index, high, color=darkBlue, width=1)
if finalBullSMT and plotAllowed
line.new(bar_index[1], low[1], bar_index, low, color=darkBlue, width=1)
// ===== PSP DESENHO =====
plotshape(finalPSP, style=shape.circle, location=location.abovebar, color=color.rgb(70,70,70), size=size.tiny)
indicator("WM SMT + PSP PRO", overlay=true, max_lines_count=500)
// ===== INPUTS =====
symbol1 = input.symbol("NQ1!", "Ativo 1")
symbol2 = input.symbol("ES1!", "Ativo 2")
symbol3 = input.symbol("YM1!", "Ativo 3")
useCustomTF = input.bool(false, "Usar timeframe personalizado?")
customTF = input.timeframe("60", "Timeframe personalizado")
useClosedBar = input.bool(true, "Apenas barra fechada?")
barsBack = input.int(100, "Plotar divergências das últimas X barras", minval=1)
// ===== TIMEFRAME =====
tf = useCustomTF ? customTF : timeframe.period
// ===== DADOS SMT =====
h1 = request.security(symbol1, tf, high)
l1 = request.security(symbol1, tf, low)
h2 = request.security(symbol2, tf, high)
l2 = request.security(symbol2, tf, low)
h3 = request.security(symbol3, tf, high)
l3 = request.security(symbol3, tf, low)
// ===== DADOS PSP =====
o1 = request.security(symbol1, tf, open)
c1 = request.security(symbol1, tf, close)
o2 = request.security(symbol2, tf, open)
c2 = request.security(symbol2, tf, close)
o3 = request.security(symbol3, tf, open)
c3 = request.security(symbol3, tf, close)
// ================= SMT =================
rh1 = h1[1]
rl1 = l1[1]
rh2 = h2[1]
rl2 = l2[1]
rh3 = h3[1]
rl3 = l3[1]
bH1 = h1 > rh1
bH2 = h2 > rh2
bH3 = h3 > rh3
bL1 = l1 < rl1
bL2 = l2 < rl2
bL3 = l3 < rl3
bearishSMT = (bH1 or bH2 or bH3) and not (bH1 and bH2 and bH3)
bullishSMT = (bL1 or bL2 or bL3) and not (bL1 and bL2 and bL3)
finalBearSMT = useClosedBar ? bearishSMT and barstate.isconfirmed : bearishSMT
finalBullSMT = useClosedBar ? bullishSMT and barstate.isconfirmed : bullishSMT
// ================= PSP =================
bull1 = c1 > o1
bull2 = c2 > o2
bull3 = c3 > o3
bear1 = c1 < o1
bear2 = c2 < o2
bear3 = c3 < o3
psp = (bull1 or bull2 or bull3) and (bear1 or bear2 or bear3)
finalPSP = useClosedBar ? psp and barstate.isconfirmed : psp
// ===== CONTROLE HISTÓRICO =====
plotAllowed = bar_index >= (bar_index - barsBack)
// ===== SMT DESENHO =====
darkBlue = color.rgb(0, 0, 139)
if finalBearSMT and plotAllowed
line.new(bar_index[1], high[1], bar_index, high, color=darkBlue, width=1)
if finalBullSMT and plotAllowed
line.new(bar_index[1], low[1], bar_index, low, color=darkBlue, width=1)
// ===== PSP DESENHO =====
plotshape(finalPSP, style=shape.circle, location=location.abovebar, color=color.rgb(70,70,70), size=size.tiny)
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.