RicardoSantos

Function 2 Point Line using UNIX TIMESTAMP V0

110 2 9
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.
Remove from Favorite Scripts Add to Favorite Scripts
//@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)
Thanks Ricardo... but I'm having a hard time to convert this to a script that can be used on a daily timeframe... Can you help, please?
Reply
RicardoSantos PRO accidentjev2
sure
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out