Pine script 应在每次计算时调用该函数以确保一致性,控制台输出?

Pine script 应在每次计算时调用该函数以确保一致性,控制台输出?,pine-script,trading,Pine Script,Trading,当我添加到图表或保存时,我的脚本最近刚开始在控制台中显示这些行 "The function 'anonym_function_10' should be called on each calculation for consistency. It is recommended to extract the call from the ternary operator or from the scope." "The function 'anonym_function

当我添加到图表或保存时,我的脚本最近刚开始在控制台中显示这些行

"The function 'anonym_function_10' should be called on each calculation for consistency. It is recommended to extract the call from the ternary operator or from the scope."
"The function 'anonym_function_11' should be called on each calculation for consistency. It is recommended to extract the call from the ternary operator or from the scope." 
需要一些帮助来理解这一点,无论代码的准确性受到影响,还是这在将来可能是一个问题?解决这个问题的办法是什么

// @version=4
f_top_fractal(src) => src[4] < src[2] and src[3] < src[2] and src[2] > src[1] and src[2] > src[0]
f_bot_fractal(src) => src[4] > src[2] and src[3] > src[2] and src[2] < src[1] and src[2] < src[0]
f_fractalize(src) => f_top_fractal(src) ? 1 : f_bot_fractal(src) ? -1 : 0
/@version=4
f_top_fractal(src)=>src[4]src[1]和src[2]>src[0]
分形(src)=>src[4]>src[2]和src[3]>src[2]和src[2]f_顶部_分形(src)?1:f_bot_fractal(src)-1 : 0

最后一行是有问题的…

如果您的代码是这样的,则可能会出现此错误

mav = na(xem[1]) ? sma(src, len) : (xem[1] / len)`
像这样试试

_sma= sma(src, len)
mav = na(xem[1]) ? _sma : (xem[1] / len)

那么,我该如何重写代码以避免出现此错误呢?谢谢您的回答,但根据您的回答,还不清楚为什么会出现此错误。你能解释一下原因吗?谢谢这对我很有用。预先计算表达式在三元运算符中起作用,在这种情况下,
sma(src,len)
被计算,然后在三元运算符中使用。