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)