标签: plot user-defined-functions pine-script trading algorithmic-trading
试图获得pinescript中先前最高价的值,但是这段代码为我提供了当前最高最高价的前一柱。
myper=input(50, "LENGTH") y1 = highest(high,myper) yy = valuewhen(high>y1[1],high,0) plot(yy[1], linewidth=2, color=#00FF00, title="alt")
任何人都可以帮忙吗?
答案 0 :(得分:0)
那是因为您在[1]函数中使用了yy系列的前一个值(plot())。
[1]
yy
plot()
//@version=4 study("My Script") myper=input(50, "LENGTH") y1 = highest(high,myper) yy = valuewhen(high>y1[1],high,0) plot(yy, linewidth=2, color=#00FF00, title="alt")