RicardoSantos

Function 2 Point Line using UNIX TIMESTAMP V0

method to draw 2 point line using unix timestamp.

note: works only in intraday timeframes, for others will need to calculate the timeframe period in unix timestamp.
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//@version=2
study("Function 2 Point Line using UNIX TIMESTAMP V0", overlay=true)
offset = input(100)
_p0 = 1.07518
_t0 = 1446828000000.0000
_p1 = 1.07407
_t1 = 1446832500000.0000

//plot(n)
//bgcolor(n==_t0?black:na, transp=25)
//bgcolor(n==_t1?black:na, transp=25)

f_2p_line(_price0, _time0, _price1, _time1, _shift) => _price0 + (((_price1 - _price0) / (_time1 - _time0)) * ((time + (_shift*interval*60000)) - _time0))

plot(f_2p_line(_p0, _t0, _p1, _t1, offset), color=black, offset=offset)