weiwei1467

NMKT/Ghost Pivots

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

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?
//@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)