TradingView
JayRogers
2021年3月8日上午9點00分

Example - Future Line Drawing 

Bitcoin / U.S. dollarBitstamp

描述

Example primarily focuses on:

• creating a simple function to get a time offset value
• using the offset to set drawing locations in the future
• how to properly set up and manipulate line positions

Extras ( end of script ):

• inclusion of vertical lines for visualising start and end points using the time offsets
• inclusion of label to read out the current time offset forwards/backwards

This script publication is intended for:

• Educational Purposes

Who is it for?

• anyone who wants to learn the basics of drawing using 'time' for purposes of positioning
評論
AlexEg
Great code, nice to read
JayRogers
@AlexEg, Thankyou :)
brijtiwari28
many thanks for this indicator Jay, the comments between the code are really helpful, thanks again.
elScipio
Thanks so much for this. Time-time(1) Works like a charm on 24/7 markets.. but does not work on stocks or currency for some reason. Been trying to find a fix for this but proving difficult. Any thoughts on how to get this to work on markets that are not open 24/7?
elScipio
@aj7919, no worries - figured it out - line.set_xloc(id, bar_index+1, bar_index+10, xloc.bar_index) - this works across all instruments
CR-JE
can you show how to extend these lines ?
i tried almost everything but no succes
// Calculate support and resistance levels
resistance = highest(high, 60)
support = lowest(low, 60)

plot(resistance, color=color.rgb(143, 139, 139), title="resistance", linewidth=2)
plot(support, color=color.rgb(56, 58, 56), title="support", linewidth=2)
manjitkumarpoonia
hi its really nice,thank you for sharing. though i was wondering if its possible to add another offset to make it look like a lagging span of ichimoku with sma
X-Algo
Really nice...
i'm trying to input some offset for my signal but in real time frame with no delay can you help me
please thanks
rizwanali009
would you please tell us in simple words. what is this indicator for ?
JayRogers
@rizwanali009, It is meant to try and help people who are interested in creating their own indicators to get to grips with the basics ins-and-outs of using 'line.new' and setting offsets for it. This script in itself is not intended to be used as an indicator on it's own.
更多