简体   繁体   中英

Plot a value also for the last (current) bar

I'm plotting a line that changes its value every month:

lastmonth_high = security(syminfo.tickerid, "M", high) 
plot(lastmonth_high, color=lastmonth_high != lastmonth_high[1] ? na : color.blue, style=plot.style_line, linewidth=3)

This way it plots no value at the actual bar. How can I extend the line one bar to the right ?

try this

lastmonth_high = security(syminfo.tickerid, "M", high, lookahead = barmerge.lookahead_on)
plot(lastmonth_high, color=lastmonth_high != lastmonth_high[1] ? na : color.blue, style=plot.style_line, linewidth=3)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM