【发布时间】:2020-09-10 09:23:08
【问题描述】:
我需要有人将这行 pine-script 代码解释或转换为任何其他语言:
TrendUp = close[1] > TrendUp[1] ? max(100, TrendUp[1]) : 100
其实奇怪的是TrendUp[1]。它是如何评估的,它的价值是什么?
完整代码为:
Up = hl2 - atr(1)
Dn = hl2 + atr(1)
TrendUp = close[1] > TrendUp[1] ? max(Up, TrendUp[1]) : Up
TrendDown = close[1] < TrendDown[1] ? min(Dn, TrendDown[1]) : Dn
Trend = close > TrendDown[1] ? 1 : close < TrendUp[1] ? -1 : nz(Trend[1], 0)
plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=1000, minheight=50, transp=85)
plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=1000, minheight=50, transp=85)
图表上的结果是那些长长的红色/绿色垂直箭头:
提前致谢。
【问题讨论】:
标签: pine-script trading indicator