weiwei1467

NMKT/Ghost Pivots

modified from Booker/Palladino Ghost Pivot
adjusted to move pivot forward

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
//@nmktse mod
// mod from Booker/Palladino Ghost Pivots
//@version=2

//plot(close)

study(title="NMKT/Ghost Pivots", shorttitle="Ghost Pivots", overlay=true)

sd = input(true, title="Show Next Day Pivot")

sw = input(true, title="Show Next Week Pivot")

sm = input(true, title="Show Next Month Pivot")

sy = input(true, title="Show Next Year Pivot")

gp = input(true, title="Show all ghost pivots")

//TODO: Need to change offsets so pivot is drawn ahead of last bar. The offset


intradayTF=1440/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



//tomorrows pivot

dtime_pivot = iff(sd==true, security(tickerid, 'D', hlc3[0]), na)

//Next Weeks pivot

wtime_pivot = iff(sw == true, security(tickerid, 'W', hlc3[0]), na)

//Next Months pivot

mtime_pivot = iff(sm == true, security(tickerid, 'M', hlc3[0]), na)

//Next Year pivot

ytime_pivot = iff(sy == true, security(tickerid, '12M', hlc3[0]), na)


//plots
plotchar(dtime_pivot, color=blue,transp=70, char="-",text="",size=size.small, location = location.absolute, offset=day_offset)
plotchar(wtime_pivot, color=red,transp=70, char="-",text="",size=size.small, location = location.absolute, offset=week_offset)
plotchar(mtime_pivot, color=purple,transp=70, char="-",text="",size=size.small, location = location.absolute, offset=month_offset)
plotchar(ytime_pivot, color=orange,transp=70, char="-",text="", size=size.small, location = location.absolute, offset=year_offset)