OPEN-SOURCE SCRIPT

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[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)
nextpivot

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明