如何在松树脚本中获取特殊栏的编号

时间:2020-09-11 15:05:47

标签: pine-script

我正在尝试获取松树脚本中的小节编号。 例如,我想为每个24条找到最高的条。 我需要那个酒吧的数量而不是价值。 我尝试过

Highest(high,24)

但是它会返回值!!!!

1 个答案:

答案 0 :(得分:0)

请参见highesbars()

//@version=4
study("")
hi = highest(high,24)
hiIndex = - highestbars(high, 24)
hiBarIndex = bar_index[hiIndex]

plot(hi, "hi")
plot(hiIndex, "hiIndex")
plot(hiBarIndex, "hiBarIndex")