AFL:将当前收盘价与之前的高点进行比较
我是 AFL 新手。我想检查当前蜡烛收盘价是否大于前一个高点,但我遇到以下错误。你能帮我解决这个问题吗:
if ((lowma > minHighPrice) AND (Close[0] > High[-1]))
错误 10:下标超出范围。您不得访问 0..(BarCount-1) 范围之外的数组元素。您试图访问数组中不存在的第 -1 个元素。 错误6:IF、WHILE、FOR语句中的条件必须是数字或布尔类型。你不能在这里使用数组。请使用[]访问数组元素
if (lowma > minHighPrice) AND (Ref(Close, 0) > Ref(High,-1))
错误6:IF、WHILE、FOR语句中的条件必须是数字或布尔类型。你不能在这里使用数组。请使用 [] 访问数组元素
谢谢并问候, 哈米德
I'm new to AFL. I want to check if the current candle close is greater than the previous high but I'm experiencing the following error. Can you help me in fixing this:
if ((lowma > minHighPrice) AND (Close[0] > High[-1]))
Error 10: Subscript out of range. You must not access array elements outside 0..(BarCount-1) range.You are attempted to access non-existing -1st element of array.
Error 6: Condition in IF, WHILE, FOR statements has to be Numeric or Boolean type. YOu can not use array here. Please use [] to access array elements
if (lowma > minHighPrice) AND (Ref(Close, 0) > Ref(High,-1))
Error 6: Condition in IF, WHILE, FOR statements has to be Numeric or Boolean type. YOu can not use array here. Please use [] to access array elements
Thanks and regards,
Hameed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原始代码:
(Close[0] > High[-1])
我的建议:
Close > High[-1]) Ref(Close,-1)
尝试使用
Ref
函数Orginial Code:
(Close[0] > High[-1])
My Suggestion:
Close > Ref(Close,-1)
Try to use
Ref
function