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)