【发布时间】:2022-07-01 07:28:08
【问题描述】:
我正在尝试在之前高点的 -8%、-15%、-21% 和 -35% 处绘制水平线。
我设法得到了最高的情节,但我似乎无法用 pinescript-v5 的新复杂性绘制水平线
我已将其更改为 V3,而不是 V5。我大致明白了,但我想将最高值作为浮点数而不是系列
这是我当前的脚本:
//@version=3
study(title="The Adam Khoo Magic", overlay=true)
//Input options
highlength = input(title="High Length", defval=20, type=integer)
//calculate values
highhighs = highest(high, length=highlength)
minuseight = highhighs*0.92
minusfifteen = highhighs*0.85
minustwentyone = highhighs*0.79
minusthirtyfive = highhighs*0.65
p8 = plot(minuseight, title="-8%", color=olive, linewidth=2, style=line)
p15 = plot(minusfifteen, title="-15%", color=purple, linewidth=2, style=line)
p21 = plot(minustwentyone, title="-21%", color=navy, linewidth=2, style=line)
p35 = plot(minusthirtyfive, title="-35%", color=black, linewidth=2, style=line)
fill(p8, p15, color=red)
fill(p15, p21, color=blue)
fill(p21, p35, color=green)
//plot values on the chart
plot(series=highhighs, color=green, linewidth=1)
plot(minuseight, title="-8%", color=olive, linewidth=2, style=line)
plot(minusfifteen, title="-15%", color=purple, linewidth=2, style=line)
plot(minustwentyone, title="-21%", color=navy, linewidth=2, style=line)
plot(minusthirtyfive, title="-35%", color=black, linewidth=2, style=line)
【问题讨论】:
标签: pine-script