structureLookback = input(title="Lookback", type=input.integer, defval=7, group=trs)
targetBarIndex = input(title="Bar Index", type=input.integer, defval=0, group=trs)
//bar_index low high
n = bar_index < targetBarIndex ? na : bar_index - targetBarIndex
pivotLowHigh = tradeType == "Long" ? (bar_index < targetBarIndex ? na : low[n]) : bar_index < targetBarIndex ? na : high[n]
//Fib Trailing variablen
var Price = 0.0
t_Price = tradeType == "Long" ? highest(high, structureLookback) : lowest(low, structureLookback)
//Berechnung des Fib-Levels
fib_m23 = Price-(Price-pivotLowHigh)*(-0.236)
//Update Price aufgrund von Price Action
if ((bar_index >= targetBarIndex and targetBarIndex != 0)or targetBarIndex==0)
//long version
if (t_Price > Price or Price == 0.0) and tradeType == "Long"
Price := t_Price
plot(pivotLowHigh, color=color.gray, title="SwingLow")
使用设置的条形索引使我的枢轴低点的功能的这一部分有效,但是在 10-20 秒后我得到了运行时错误。
Pine 无法确定系列的参考长度。尝试使用 max_bars_back
为什么会出现此错误?以及我必须改变的任何建议?