0% found this document useful (0 votes)
225 views9 pages

Scriptde Ouro

The document provides a script for the TradingView platform to analyze financial charts and identify trading signals. It includes indicators like the MACD, RSI, EMAs, and Bollinger Bands to detect patterns like J-Hooks and Scoops. Alerts are triggered when signals are generated, such as crossover/crossunder of moving averages or when specific patterns are identified.

Uploaded by

Alison Santos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
225 views9 pages

Scriptde Ouro

The document provides a script for the TradingView platform to analyze financial charts and identify trading signals. It includes indicators like the MACD, RSI, EMAs, and Bollinger Bands to detect patterns like J-Hooks and Scoops. Alerts are triggered when signals are generated, such as crossover/crossunder of moving averages or when specific patterns are identified.

Uploaded by

Alison Santos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

portugues

8,2x ¹ 7,3x
matematica
9,1x ¹ 2,1x
geografia
4,1x
História
1,4x
Informática
5
Administração Pública
4,1x

abra sua conta no Trading View ,em seguida vá até adicionar novo script e coloque
isto:
(sem as aspas)

"// @ sincoraalison
//@version=5

indicator("Scalp",overlay=true,max_bars_back=1000,max_lines_count=500,max_labels_co
unt=500)
length = input.float(200,'Window Size',maxval=500,minval=0)
b = input.float(3.,'Bandwidth')
mult = input.float(5.)
//src = input.source(src,'SourceHigh')

//
src = (high+low)/2

[macdLine, signalLine, histLine] = ta.macd(src, 12, 26, 9)


rsi2 = ta.rsi(src,13)

fv= if ta.crossover(macdLine,signalLine) and rsi2 > 70


open
vf= if ta.crossunder(macdLine,signalLine) and rsi2 < 30
open
//--
//plotshape(fv, style=shape.circle, location=location.belowbar, color=color.green,
size=size.small,text ="",textcolor = color.green)
//plotshape(vf, style=shape.circle, location=location.abovebar, color=color.red,
size=size.small,text ="",textcolor = color.red)

length3 = input(title='Periodo', defval=1)


mult3 = input.float(title='Multiplier', step=01, defval=06.18033988749895)
showLabels = input(title='Show Buy/Sell Labels ?', defval=true)
useClose = input(title='Use Close Price for Extremums ?', defval=true)
highlightState = input(title='Highlight State ?', defval=true)

atr = mult3 * ta.atr(length3)

longStop = (useClose ? ta.highest(high, length3) : ta.highest(length3)) - atr


longStopPrev = nz(longStop[1], longStop)
longStop := close[1] > longStopPrev ? math.max(longStop, longStopPrev) : longStop

shortStop = (useClose ? ta.lowest(low, length3) : ta.lowest(length3)) + atr


shortStopPrev = nz(shortStop[1], shortStop)
shortStop := close[1] < shortStopPrev ? math.min(shortStop, shortStopPrev) :
shortStop

var int dir = 1


dir := close > shortStopPrev ? 1 : close < longStopPrev ? -1 : dir

var color longColor = color.green


var color shortColor = color.red

//longStopPlot = plot(dir == 1 ? longStop : na, title='Long Stop',


style=plot.style_linebr, linewidth=2, color=color.new(longColor, 0))
buySignal = dir == 1 and dir[1] == -1
plotshape(buySignal ? longStop : na, title='Long Stop Start',
location=location.absolute, style=shape.circle, size=size.tiny,
color=color.new(longColor, 0))
//plotshape(buySignal and showLabels ? longStop : na, title='Buy Label',
text='Buy', location=location.absolute, style=shape.labelup, size=size.tiny,
color=color.new(longColor, 0), textcolor=color.new(color.white, 0))

//shortStopPlot = plot(dir == 1 ? na : shortStop, title='Short Stop',


style=plot.style_linebr, linewidth=2, color=color.new(shortColor, 0))
sellSignal = dir == -1 and dir[1] == 1
plotshape(sellSignal ? shortStop : na, title='Short Stop Start',
location=location.absolute, style=shape.circle, size=size.tiny,
color=color.new(shortColor, 0))
//plotshape(sellSignal and showLabels ? shortStop : na, title='Sell Label',
text='Sell', location=location.absolute, style=shape.labeldown, size=size.tiny,
color=color.new(shortColor, 0), textcolor=color.new(color.white, 0))

midPricePlot = plot(ohlc4, title='', style=plot.style_circles, linewidth=0,


display=display.none, editable=false)

longFillColor = highlightState ? dir == 1 ? longColor : na : na


shortFillColor = highlightState ? dir == -1 ? shortColor : na : na
//fill(midPricePlot, longStopPlot, title='Long State Filling', color=longFillColor,
transp=90)
//fill(midPricePlot, shortStopPlot, title='Short State Filling',
color=shortFillColor, transp=90)

changeCond = dir != dir[1]


alertcondition(changeCond, title='Direction Change', message='direction!')
alertcondition(buySignal, title='Buy', message='Buy!')
alertcondition(sellSignal, title='Sell', message='Sell!')

tt = sellSignal ? longStop : na - (sellSignal ? longStop : na * 0.618)


vv = buySignal ? shortStop : na + (buySignal ? shortStop : na * 0.618)

plotshape(tt, title='PIVOTPOINTdn', location=location.absolute, style=shape.xcross,


size=size.tiny, color=color.new(color.white, 0))
plotshape(vv, title='PIVOTPOINTup', location=location.absolute, style=shape.xcross,
size=size.tiny, color=color.new(color.white, 0))
n = bar_index
hi = high
l = low
c = close

//~~~}
p1 = plot(ta.ema(close,200), 'EMA 200', color.blue, 1 , plot.style_line , false)
p2 = plot(ta.hma(close,55), 'HMA 55',color.white, 1 , plot.style_line , false)
//--
hma = ta.hma(close,53)
sma = ta.sma(close,20)
plot(sma,'Sma20',color.gray,1,plot.style_line,true)
//---
//emas = ta.ema(close,169)
//plot(emas,"Ema small",color.gray,3)
//emab = ta.ema(close,274)
//plot(emab,"Ema big",color.gray,3)
//---

var k = 2
var upper = array.new_line(0)
var lower = array.new_line(0)

var val = float(na)


var index = array.new<int>(2,0)
var count = 0

var k2 = 2
var upper2 = array.new_line(0)
var lower2 = array.new_line(0)
//---
lset(l,x1,y1,x2,y2,col)=>
line.set_xy1(l,x1,y1)
line.set_xy2(l,x2,y2)
line.set_color(l,col)
line.set_width(l,2)
//--
//lset(l,x1,y1,x2,y2,col)=>
// line.set_xy1(l,x1,y1)
// line.set_xy2(l,x2,y2)
// line.set_color(l,col)
// line.set_width(l,2)
//--
if barstate.isfirst
for i = 0 to length/k-1
array.push(upper,line.new(na,na,na,na))
array.push(lower,line.new(na,na,na,na))
//----
line up = na
line dn = na
//----
cross_up = 0.
cross_dn = 0.
//----
if barstate.islast
y = array.new_float(0)

sum_e = 0.
for i = 0 to length-1
sum = 0.
sumw = 0.

for j = 0 to length-1
w = math.exp(-(math.pow(i-j,2)/(b*b*2)))
sum += src[j]*w
sumw += w

y2 = sum/sumw
sum_e += math.abs(src[i] - y2)
array.push(y,y2)

mae = sum_e/length*mult

for i = 1 to length-1
y2 = array.get(y,i)
y1 = array.get(y,i-1)

up := array.get(upper,i/k)
dn := array.get(lower,i/k)

lset(up,n-i+1,y1 + mae,n-i,y2 + mae,color.red)


lset(dn,n-i+1,y1 - mae,n-i,y2 - mae,color.green)

if src[i] > y1 + mae and src[i+1] < y1 + mae


label.new(n-
i,src[i],'▼',color=#00000000,style=label.style_label_down,textcolor=color.red,texta
lign=text.align_center)
if src[i] < y1 - mae and src[i+1] > y1 - mae
label.new(n-
i,src[i],'▲',color=#00000000,style=label.style_label_up,textcolor=color.green,texta
lign=text.align_center)
if hma[i] > y1 + mae and hma[i+1] < y1 + mae//src[i] < hma and src[i] <
y1+mae and hma < y1+mae //// hma[i] > y1 + mae and hma[i+1] < y1 + mae
label.new(n-i, src[i], "SHORT▼▼▼",color =
#00000000,textcolor=color.red,style= label.style_label_down,textalign=
text.align_center,size = size.small)
else if (macdLine > signalLine and rsi2 > 50) and (hma[i] > y1 + mae and
hma[i+1] < y1 + mae)
label.new(n, src[i], "RIGHTHERE▼",color =
#00000000,textcolor=color.red,style= label.style_label_down,textalign=
text.align_center,size = size.small)
if hma[i] < y1 - mae and hma[i+1] > y1 - mae//src[i] > hma and src[i] > y1-
mae and hma > y1-mae //// hma[i] < y1 - mae and hma[i+1] > y1 - mae
label.new(n-i, src, "LONG▲▲▲",color =
#00000000,textcolor=color.green,style=label.style_label_up,textalign=
text.align_center,size = size.small)
else if (macdLine < signalLine and rsi2 < 50) and (hma[i] < y1 - mae and
hma[i+1] > y1 - mae)
label.new(n-i, src[i], "RIGHTHERE▲",color =
#00000000,textcolor=color.green,style=label.style_label_up,textalign=
text.align_center,size = size.small)
alertcondition(ta.crossover(src,cross_up),'Down','Down')
alertcondition(ta.crossunder(src,cross_dn),'Up','Up')
alertcondition(ta.crossover(hma,cross_up),"SHORT","SHORT")
alertcondition(ta.crossunder(hma,cross_dn),"LONG","LONG")

// Calculate the MACD values


// Plot the MACD line

//
//ss= if ta.crossover(hma,cross_dn)
//close
//sl= if ta.crossunder(hma,cross_up)
//close
//

//plotshape(close,'STOPSHORT',shape.xcross,location.absolute,color.white)
//plotshape(close,"STOPLONG",shape.xcross,location.absolute,color.white)
// Detects the J-Hook pattern
jHook = low < ta.lowest(low, 20) and close > high[1] and close > open and close <
close[1] and close > (high[1] + close[1])/2 and close > (open + close[1])/2 and
close > (open + high[1])/2

// Plots the pattern as green bars


barcolor(jHook ? color.green : na)
plotshape(jHook,'J-
HOOK',shape.diamond,location.abovebar,color.green,0,"JHOOOKCOMPRE")

//"Scoop Patern")

// Define inputs
lengths = input(50, title="Length")
multiplier = input(2, title="Multiplier")

// Calculate moving average


ma = ta.ema(close, lengths)

// Calculate upper and lower bands


upperj = ma + multiplier * ta.stdev(close, lengths)
lowerj = ma - multiplier * ta.stdev(close, lengths)
upper1 = ma + 2 * ta.stdev(src, 13)
lower3 = ma - 2 * ta.stdev(src, 13)
//--
// Detect Scoop pattern
scoop = (close > upperj) and (low < ma) and (src < ma)
scoopdn = (close < lowerj) and (high > ma) and (src > ma)
// Plot Scoop pattern
plotshape(scoop, style=shape.triangleup, location=location.belowbar,
color=color.green, size=size.small,text ="SCOOPUP",textcolor = color.green)
plotshape(scoopdn, style=shape.triangledown, location=location.abovebar,
color=color.red, size=size.small,text ="SCOOPDN",textcolor = color.red)

alertcondition(scoop, title='SCOOP', message='B!')


alertcondition(scoopdn, title='SCOOP', message='S!')

///
//ema20 = ta.ema(close,20)
//vn = ta.lowest(close,6)
//cp = ta.highest(close,6)
//ofertadn = (close < upperj) and (low < low[5]) and (close < ma)
//demandadn = (low < vn) and (ema20 > close) and (close < ma)
//ofertacp = (close < lowerj) and (high > high[5]) and (close > ma)
//demandaup = (high > cp) and (ema20 < close) and (close > ma)
//plotshape(ofertacp,'OFERTAUP',shape.circle,location.abovebar,color.green,0,size=
size.tiny)
//plotshape(ofertadn,'OFERTADN',shape.circle,location.belowbar,color.red,0,size=
size.tiny)
//plotshape(demandaup,'DMDUP',shape.circle,location.abovebar,color.green,0,size=
size.tiny)
//plotshape(demandadn,'DMDDN',shape.circle,location.belowbar,color.red,0,size=
size.tiny)

//Diamond TOP AND BOTTOM

// Diamond Top
//diamondTop = (high[1] > high[2] and high[1] > high) and (low[1] < low[2] and
low[1] < low) and (high[2] > high[3] and high[2] > high[4]) and (low[3] < low[2]
and low[4] < low[2])
//plotshape(diamondTop, title="Diamond Top", style=shape.labeldown,
location=location.abovebar, color=color.red, text="DIAMONDDN", size=size.tiny)

// Diamond Bottom
//diamondBottom = (high[1] > high[2] and high[1] > high) and (low[1] < low[2] and
low[1] < low) and (low[2] < low[3] and low[2] < low[4]) and (high[3] > high[2] and
high[4] > high[2])
//plotshape(diamondBottom, title="Diamond Bottom", style=shape.labelup,
location=location.belowbar, color=color.green, text="DIAMONDUP", size=size.tiny)
entry = src / close
vol = volume / entry

lengths3 = input(13, title="Length")

obv = 0.0
obv := na(obv[1]) ? vol : (src > close[1] ? obv[1] + vol : (src < close[1] ? obv[1]
- src : obv[1]))

obv1=if obv > 0


open
//--
p = obv + 1
highest = ta.highest(src,13)
lowest = ta.lowest(src,13)

obv2=if p > 1
open
multiplier3 = (obv1 + ma)/2
multiplier2 = (obv2 + ma)/2
ix = ma + multiplier3 * ta.stdev(src,lengths3)
ex = ma - multiplier2 * ta.stdev(src,lengths3)
// open
//
x= if (close > ex) and (low < ma) and (src > ma)
open

//---
u= if (close < ix) and (high > ma) and (src < ma)
open
//--
//--
plotshape(x, style=shape.triangleup, location=location.belowbar, color=color.gray,
size=size.tiny,text ="VOLb",textcolor = color.gray)
plotshape(u, style=shape.triangledown, location=location.abovebar,
color=color.gray, size=size.tiny,text ="VOLs",textcolor = color.gray)

buy=if vol > volume and ((close > upper1) and (low < ma) and (src > ma))
close
//--
sel=if vol < volume and ((close < lower3) and (high > ma) and (src > ma))
close

//--
plotshape(buy,"Compra",style= shape.triangleup,location = location.belowbar, color=
color.green,text= 'Compre',textcolor = color.green,size = size.small)
plotshape(sel,"Venda",style= shape.triangledown,location = location.abovebar,
color= color.red,text= "Vende",textcolor = color.red,size= size.small)
//--
alertcondition(buy,"compra","compra")
alertcondition(sel,"venda","venda")
//--
m7 =if buy and fv
open
//--
m8 =if sel and vf
open
//--

plotshape(m7,"Compra",style= shape.xcross,location = location.belowbar, color=


color.green,text= 'Forte',textcolor = color.green,size = size.normal)
plotshape(m8,"Venda",style= shape.xcross,location = location.abovebar, color=
color.red,text= "Forte",textcolor = color.red,size = size.normal)
//--
bn =if (high[3] < high[2] and high[2] > high[1]) and (high > src)
open
//--
nb =if (low[3] > low[2] and low[2] < low[1]) and (low < src)
open
//--

hn = nb < lowest
nh = bn > highest

//plot(src,'src',color.yellow,5)
plotshape(hn,"Compra",style= shape.circle,location = location.belowbar, color=
color.green,text= '↑',textcolor = color.green)
plotshape(nh,"Venda",style= shape.circle,location = location.abovebar, color=
color.red,text= "↓",textcolor = color.red)
alertcondition(hn,"subiu","compra")
alertcondition(nh,"desceu","venda")
//--
cl =if (low < lowest) and (ma < src)
open
bl =if (high > highest) and (ma > src)
open

R = (cl + bl)/2
vs=if R < ix
open
cs=if R > ex
open

//---

///plot(src, title="Resistance", color=color.blue, style=plot.style_linebr)

m=if x and cl
open
//--
m1=if u and bl
open
//--

plotshape(m,"Compra",style= shape.square,location = location.belowbar, color=


color.green,text= "s",textcolor = color.green)
plotshape(m1,"Venda",style= shape.square,location = location.abovebar, color=
color.red,text= "r",textcolor = color.red)
//--
plotshape(cs,"Compra",style= shape.square,location = location.belowbar, color=
color.green,text= 's',textcolor = color.green)
plotshape(vs,"Venda",style= shape.square,location = location.abovebar, color=
color.red,text= "r",textcolor = color.red)
//--

o =if obv < 0


open
//--

mu=if obv1 * (1 - 2.236/2)


open
um=if o * (1 - 2.236/2)
open
//
er = src + mu * ta.stdev(src,28)
re = src - um * ta.stdev(src,26)

gv = (close > er) and (low < src) and (src > ma)
vg = (close < re) and (high > src) and (src < ma)

kl=if gv and (lowest < low)


open
lk=if vg and (highest > high)
open
///--
tr =if (high[5] < high[3] and high[3] > high[5]) and (high > src)
open
//--
rt =if (low[5] > low[3] and low[3] < low[5]) and (low < src)
open
//---
plotshape(kl,"Compra",style= shape.square,location = location.belowbar, color=
color.green,text= "Compra volumosa",textcolor = color.green)
plotshape(lk,"Venda",style= shape.square,location = location.abovebar, color=
color.red,text= "Venda Volumosa",textcolor = color.red)
///--

iu=if obv1 * (1 - 2.236/2)


open
ui=if o * (1 - 2.236/2)
open
//
uy = src + iu * ta.ema(src,20)
yu = src - ui * ta.ema(src,20)

gh = (close > uy) and (low < src) and (src > ma)

hg = (close < yu) and (high > src) and (src < ma)

yt =if gh and rt
open
//--
ty =if hg and tr
open
///---

plotshape(yt,"Compra",style= shape.square,location = location.belowbar, color=


color.green,text= "Buy",textcolor = color.green)
plotshape(ty,"Venda",style= shape.square,location = location.abovebar, color=
color.red,text= "Sell",textcolor = color.red)

mx =if hn and (rt > sma)


open
xm =if nh and (tr < sma)
open
//--

plotshape(mx,"Compra",style= shape.square,location = location.belowbar, color=


color.green,text= "pCompra",textcolor = color.green)
plotshape(xm,"Venda",style= shape.square,location = location.abovebar, color=
color.red,text= "pVenda",textcolor = color.red)"####

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy