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)
Geschütztes Skript
Dieses Script ist als Closed-Source veröffentlicht. Sie können es kostenlos und ohne Einschränkungen verwenden – erfahren Sie hier mehr.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Geschütztes Skript
Dieses Script ist als Closed-Source veröffentlicht. Sie können es kostenlos und ohne Einschränkungen verwenden – erfahren Sie hier mehr.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.