TRADINGVIEW / PINESCRIPT
#1
hello SMPipol banana

Anyone using tradingview here and knows how to code pinescript?? Smile
Nakita ko kasi na pwedi kang gumawa nang sariling indicator doon using pinescript na LIBRE.....

since downtrend pa ang market ito na muna pagkaka-abalahan ko..

ANG TANONG!

paano po maglagay nang pse stocks doon?? Big Grin



TY in advance winking at sana po share2x tayo nang pinescript code dito!!

Reply
#2
//@version=3

study(title="StoRSI", shorttitle="StoRSI", overlay = false)
periodK = input(11, title="K", minval=1)
periodD = input(3, title="D", minval=1)
smoothK = input(10, title="Smooth", minval=1)
k = sma(stoch(close, high, low, periodK), smoothK)
d = sma(k, periodD)
plot(k, title="%K", color=blue)
plot(d, title="%D", color=red)
h0 = hline(80,"TOP", color=maroon)
h1 = hline(20,"BOT", color=green)
fill(h0, h1, color=purple, transp=100)


src1 = close, len = input(5, minval=1, title="RSIlength")
up = rma(max(change(src1), 0), len)
down = rma(-min(change(src1), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, color=purple)
band1 = hline(70)
band0 = hline(30)
fill(band1, band0, color=purple, transp=90)


combined STO and RSI
Reply
#3
//@version=2
study(title="PIVOTS", shorttitle="PIVOTS", overlay=true)

sa = input(false,title="Show Pivot Average")
sd = input(true, title="Show Daily Pivots?")
sw = input(true, title="Show Weekly Pivots?")
sm = input(true, title="Show Monthly Pivots?")



// Classic Pivot
pivot = (high + low + close ) / 3.0

// Classic Pivots
r1 = (2*pivot) - low
s1 = (2*pivot) - high
r2 = pivot + (high - low)
s2 = pivot - (high - low)
r3 = high + (2*(pivot-low))
s3 = low - (2*(high - pivot))
//Pivot Average Calculation
smaP = sma(pivot, 3)


//Daily Pivots
dtime_pivot = security(tickerid, 'D', pivot[1])
dtime_pivotAvg = security(tickerid, 'D', smaP)
dtime_r1 = security(tickerid, 'D', r1[1])
dtime_s1 = security(tickerid, 'D', s1[1])
dtime_r2 = security(tickerid, 'D', r2[1])
dtime_s2 = security(tickerid, 'D', s2[1])
dtime_r3 = security(tickerid, 'D', r3[1])
dtime_s3 = security(tickerid, 'D', s3[1])

//offs_daily = 0
plot(series=isintraday and sa and sd and dtime_pivotAvg ? dtime_pivotAvg : na, title="Daily Pivot Average",style=line, color=orange,linewidth=1)
plot(series=isintraday and sd and dtime_pivot ? dtime_pivot : na, title="D_PP",color=dtime_pivot[1] - dtime_pivot[0] ?na:fuchsia,linewidth=1)
plot(series=isintraday and sd and dtime_r1 ? dtime_r1 : na, title="D_R1",color=dtime_pivot[1] - dtime_pivot[0] ?na:blue,linewidth=1)
plot(series=isintraday and sd and dtime_s1 ? dtime_s1 : na, title="D_S1",color=dtime_pivot[1] - dtime_pivot[0] ?na:blue,linewidth=1)
plot(series=isintraday and sd and dtime_r2 ? dtime_r2 : na, title="D_R2",color=dtime_pivot[1] - dtime_pivot[0] ?na:blue,linewidth=1)
plot(series=isintraday and sd and dtime_s2 ? dtime_s2 : na, title="D_S2",color=dtime_pivot[1] - dtime_pivot[0] ?na:blue,linewidth=1)
plot(series=isintraday and sd and dtime_r3 ? dtime_r3 : na, title="D_R3",color=dtime_pivot[1] - dtime_pivot[0] ?na:blue,linewidth=1)
plot(series=isintraday and sd and dtime_s3 ? dtime_s3 : na, title="D_S3",color=dtime_pivot[1] - dtime_pivot[0] ?na:blue,linewidth=1)

//Weekly Pivots
wtime_pivot = security(tickerid, 'W', pivot[1])
wtime_pivotAvg = security(tickerid, 'W', smaP)
wtime_R1 = security(tickerid, 'W', r1[1])
wtime_S1 = security(tickerid, 'W', s1[1])
wtime_R2 = security(tickerid, 'W', r2[1])
wtime_S2 = security(tickerid, 'W', s2[1])
wtime_R3 = security(tickerid, 'W', r3[1])
wtime_S3 = security(tickerid, 'W', s3[1])

plot(series=isintraday and sa and sw and wtime_pivotAvg ? wtime_pivotAvg : na, title="Weekly Pivot Average",style=line, color=orange,linewidth=1)
plot(series=isintraday and sw and wtime_pivot ? wtime_pivot : na, title="W_PP",color=wtime_pivot[1] - wtime_pivot[0] ?na:fuchsia,linewidth=2)
plot(series=isintraday and sw and wtime_R1 ? wtime_R1 : na, title="W_R1",style=line, color=wtime_pivot[1] - wtime_pivot[0] ?na:lime,linewidth=2)
plot(series=isintraday and sw and wtime_S1 ? wtime_S1 : na, title="W_S1",style=line, color=wtime_pivot[1] - wtime_pivot[0] ?na:lime,linewidth=2)
plot(series=isintraday and sw and wtime_R2 ? wtime_R2 : na, title="W_R2",style=line, color=wtime_pivot[1] - wtime_pivot[0] ?na:lime,linewidth=2)
plot(series=isintraday and sw and wtime_S2 ? wtime_S2 : na, title="W_S2",style=line, color=wtime_pivot[1] - wtime_pivot[0] ?na:lime,linewidth=2)
plot(series=isintraday and sw and wtime_R3 ? wtime_R3 : na, title="W_R3",style=line, color=wtime_pivot[1] - wtime_pivot[0] ?na:lime,linewidth=2)
plot(series=isintraday and sw and wtime_S3 ? wtime_S3 : na, title="W_S3",style=line, color=wtime_pivot[1] - wtime_pivot[0] ?na:lime,linewidth=2)


//Monthly Pivots
mtime_pivot = security(tickerid, 'M', pivot[1])
mtime_pivotAvg = security(tickerid, 'M', smaP)
mtime_R1 = security(tickerid, 'M', r1[1])
mtime_S1 = security(tickerid, 'M', s1[1])
mtime_R2 = security(tickerid, 'M', r2[1])
mtime_S2 = security(tickerid, 'M', s2[1])
mtime_R3 = security(tickerid, 'M', r3[1])
mtime_S3 = security(tickerid, 'M', s3[1])


plot(sa and sm and mtime_pivotAvg ? mtime_pivotAvg : na, title="Monthly Pivot Average",style=line, color=orange,linewidth=1)
plot(sm and mtime_pivot ? mtime_pivot : na, title="M_PP",color=mtime_pivot[1] - mtime_pivot[0] ?na:fuchsia,linewidth=4)
plot(sm and mtime_R1 ? mtime_R1 : na, title="M_R1",style=line, color=mtime_pivot[1] - mtime_pivot[0] ?na:orange,linewidth=4)
plot(sm and mtime_S1 ? mtime_S1 : na, title="M_S1",style=line, color=mtime_pivot[1] - mtime_pivot[0] ?na:orange,linewidth=4)
plot(sm and mtime_R2 ? mtime_R2 : na, title="M_R2",style=line, color=mtime_pivot[1] - mtime_pivot[0] ?na:orange,linewidth=4)
plot(sm and mtime_S2 ? mtime_S2 : na, title="M_S2",style=line, color=mtime_pivot[1] - mtime_pivot[0] ?na:orange,linewidth=4)
plot(sm and mtime_R3 ? mtime_R3 : na, title="M_R3",style=line, color=mtime_pivot[1] - mtime_pivot[0] ?na:orange,linewidth=4)
plot(sm and mtime_S3 ? mtime_S3 : na, title="M_S3",style=line, color=mtime_pivot[1] - mtime_pivot[0] ?na:orange,linewidth=4)


pivot points... Smile
Reply
#4
...pibot poynts? Tongue


Reply
#5
(07-02-2019, 03:31 PM)Ollie Wrote: ...pibot poynts? Tongue

hahaha shhhssssssshhhhh ...  winking
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)