【发布时间】:2021-05-23 09:34:59
【问题描述】:
我正在尝试检查过去的 n 蜡烛是否属于同一类型。
例如,之前的五支蜡烛都是看涨的,还是都看跌的。
使用我的方法,我不断收到错误:
lines 30:37: Return type of one of the 'if' blocks is not compatible with return type of other block(s) (void; series[bool]; series[bool])
我在迭代中出了什么问题?
提前谢谢大家。
我也愿意尝试任何其他工作方法/想法。
// Determine if we have a valid setup
isBullish = true
isBearish = true
for i = (iterationCount - 1) to 0
notSeries = not(isBullish or isBearish)
if notSeries
break
else if close[i] > open[i] and isBullish
isBearish := false
else
isBullish := false
【问题讨论】:
标签: pine-script candlestick-chart