gverdu

Posible Next Pivots Script

//@posible next pivot
//based in other codes
//Modified by gverdu


study(title="Posible Next Pivots", shorttitle="Next Pivots", overlay=true)

sd = input(false, title="Show Daily Pivots?")
sw = input(true, title="Show Weekly Pivots?")
sm = input(false, title="Show Monthly Pivots?")
sq = input(false, title="Show Quarterly Pivots?")
sy = input(false, title="Show Yearly Pivots?")

pivot = (high + low + close ) / 3.0

intradayTF=1000/interval
dTF=1
wTF=1
mTF=1

TF=isintraday? intradayTF: isdaily? dTF:isweekly? wTF:ismonthly? mTF:0


daily=isintraday?TF:dTF
weekly=isintraday?daily*7:wTF
monthly=isintraday?weekly*4:mTF
yearly=isintraday?monthly*12:12

// changes depending on the current time frame being displayed.
day_offset = daily
week_offset = weekly
month_offset =monthly
year_offset = yearly



//day pivot

dtime_pivot = security(tickerid, 'D', pivot)

plot(sd and dtime_pivot ? dtime_pivot: na, color=blue,title="Next Day Pivot",style=line, linewidth=3, offset=day_offset)

//Next Weeks pivot
wtime_pivot = security(tickerid, 'W', pivot)

plot(sw and wtime_pivot ? wtime_pivot : na, title="Next Weekly Pivot",style=line, color=red,linewidth=3, offset=week_offset)
//Next Months pivot
mtime_pivot = security(tickerid, 'M', pivot)
plot(sm and mtime_pivot ? mtime_pivot: na, color=purple,title="Next Month Pivot",style=line, linewidth=3, offset=month_offset)

//Next Year pivot
ytime_pivot = security(tickerid, '12M', pivot)
plot(sy and ytime_pivot ? ytime_pivot: na, color=orange, title="Next Year Pivot",style=line,linewidth=3, offset=year_offset)
Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?
//@posible next pivot
//based in other codes
//Modified by gverdu


study(title="Posible Next Pivots", shorttitle="Next Pivots", overlay=true)

sd = input(false, title="Show Daily Pivots?")
sw = input(true, title="Show Weekly Pivots?")
sm = input(false, title="Show Monthly Pivots?")
sq = input(false, title="Show Quarterly Pivots?")
sy = input(false, title="Show Yearly Pivots?")

pivot = (high + low + close ) / 3.0 

intradayTF=1000/interval
dTF=1
wTF=1
mTF=1

TF=isintraday? intradayTF: isdaily? dTF:isweekly? wTF:ismonthly? mTF:0


daily=isintraday?TF:dTF
weekly=isintraday?daily*7:wTF
monthly=isintraday?weekly*4:mTF
yearly=isintraday?monthly*12:12

// changes depending on the current time frame being displayed.
day_offset = daily
week_offset = weekly
month_offset =monthly
year_offset = yearly



//day pivot

dtime_pivot = security(tickerid, 'D', pivot[0]) 

plot(sd and dtime_pivot ? dtime_pivot: na, color=blue,title="Next Day Pivot",style=line, linewidth=3, offset=day_offset)

//Next Weeks pivot
wtime_pivot = security(tickerid, 'W', pivot[0]) 

plot(sw and wtime_pivot ? wtime_pivot : na, title="Next Weekly Pivot",style=line, color=red,linewidth=3, offset=week_offset)
//Next Months pivot
mtime_pivot = security(tickerid, 'M', pivot[0]) 
plot(sm and mtime_pivot ? mtime_pivot: na, color=purple,title="Next Month Pivot",style=line, linewidth=3, offset=month_offset)

//Next Year pivot
ytime_pivot = security(tickerid, '12M', pivot[0]) 
plot(sy and ytime_pivot ? ytime_pivot: na, color=orange, title="Next Year Pivot",style=line,linewidth=3, offset=year_offset)