【发布时间】:2021-11-02 07:07:15
【问题描述】:
所以我只是想在收盘价在 5 根蜡烛上变化 20% 的位置下方绘制绿色三角形。 Pine 脚本给出了 plotshape 的语法错误。你不能在 plotshape 中设置条件吗?
study(title="20% change in 5 candles", overlay=true)
var Diff = 0
var PercentChange = 0
// Identify % change 5 candles away
Diff = close - close[5]
PercentChange = Diff / close[5]
// Plot signals to chart
plotshape(series=PercentChange > 0.2, title="Here", location=location.belowbar, color=color.green, style=shape.triangleup, text="here")
// Send out an alert if this candle meets our conditions
alertcondition(PercentChange > 0.2, title="20% change in 5 candles!", message="20% change in 5 candles")
【问题讨论】:
标签: plot syntax-error pine-script