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)