问题
For intraday timeframes.
Is it possible to draw a horizontal line on the first bar of the session, that has a length until the end of that session?
So, essentially drawing a line into the 'future'.
Something like this:
回答1:
It seems to be possible.
Code below is based on the answer of PineCoders-LucF to one of my previous questions line.new draws 2 lines instead of 1
//@version=4
study("FutureLine", overlay=true)
start = timestamp(2020,03,13,10,30,0)
stop = timestamp(2020,03,16,16,00,0)
level = 2575
var line ln = line.new(start, level, stop, level, xloc=xloc.bar_time)
if barstate.islast
line.set_x1(ln, start)
line.set_x2(ln, stop)
Which results in
来源:https://stackoverflow.com/questions/60659820/is-it-possible-to-draw-a-line-into-the-future