pine-script - previous quarter high and low in Pine script?
问题描述
Does anyone know what script I can use to plot the previous quarter (3 months) high and low on a daily chart in trading view? The script I use now for the previous week high and low is the following.
Regards,
Juros
Blockquote
//modified by Juros as by xKaVaLiS as modidified by zonedoutdad from the script by ChrisMoody
study(title="previous Week high & low", shorttitle="Prev Wk H-L", overlay=true, precision=8)
swt = input(true, title="Show This Weeks OHLC?")
showMonthly = input(false, title="Show Monthly Data (open/close)?")
highlightBG = input(false, title="Highlight Background Bias")
aboveBelowBarWeekIndicator = input(true, title="Turn on Above/Below Week Open Top Chart")
//Weekly
prevWeekHigh = security(tickerid, 'W', high[1], lookahead=true)
prevWeekLow = security(tickerid, 'W', low[1], lookahead=true)
//Weekly Plots
plot(swt and prevWeekHigh ? prevWeekHigh : na, title="Prev Week High", style=stepline, linewidth=1, color=green,transp=50)
plot(swt and prevWeekLow ? prevWeekLow : na, title="Prev Week Low", style=stepline, linewidth=1, color=red,transp=50)
解决方案
推荐阅读
- android - 如果 kikid 在 firebase 数据库中不包含用户 ID,该怎么办?
- c# - 如何将变量类型转换为另一种变量类型
- python - Pandas DataFrame 中的数据类型不变
- python - 如何获取用户的 Reddit 全名?
- python - 如何获取数组中变量的名称,以用作另一个语句的一部分?
- c++ - 使用 String c_str() 返回 char*
- sql - 平面到多级嵌套数据
- c++ - 有没有一种方法可以使用 2 位大小的类型而不是 int,只需插入新的类型名称而不是 int?
- r - R plot 火迹
- python - 使用 pandas matplotlib 在 x 轴上显示文本描述而不是数字