英文:
Get the high of 4hr candle from 15m chart
问题
My indicator is running on the 15 minute chart and I need to get the high of a previous 4hr candle. I have similar code working at the start that works fine. However this one section is giving me a compile error, not code is highlighted red. The 4hr candle I am looking for is high[2]
. It is this that is causing the error request.security(syminfo.tickerid, "240", high[2])
If I replace with just high[2]
then there is no error
My code is:
if filteredtopf
current_fractal_high := request.security(syminfo.tickerid, "240", high[2])
current_fractal_high_index := bar_index-2
if range_high == high[2]
range_high_fractal := true
英文:
My indicator is running on the 15 minute chart and I need to get the high of a previous 4hr candle. I have similar code working at the start that works fine. However this one section is giving me a compile error, not code is highlighted red. The 4hr candle I am looking for is high[2]
. It is this that is causing the error request.security(syminfo.tickerid, "240", high[2])
If I replace with just high[2]
then there is no error
My code is:
if filteredtopf
current_fractal_high := request.security(syminfo.tickerid, "240", high[2])
current_fractal_high_index := bar_index-2
if range_high == high[2]
range_high_fractal := true
答案1
得分: 0
问题是因为它在一个“if”语句内部。我将其从那里移出,并放入一个函数中,然后从“if”中调用。
英文:
The issue was because it was inside an if
statement. I removed from there and placed inside a function which I then call from the if
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论