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)