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)
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

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.

Möchten Sie dieses Skript auf einem Chart verwenden?
//@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)