简体   繁体   中英

Pine Script: Plot Only Selected Range

I'm trying to allow a user to set a specified range of candles back from the current candle, then plot an area graph only from 'close' values in that range.

I can't figure out how to make the new plot start only from the selected candle.

User sets range range = input(title="Range Window", type=input.integer, defval=20, minval=1)

Volume from previous close long_volume = iff(overridesym == true, long_security("1",close), close)

This is the part I don't know... plot(long_volume, (over the length of 'range'), style=plot.style_area,)

You can use the show_last parameter

//@version=5
indicator("My Script")
i = input.int(20)
plot(close, show_last=i)

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