从15分钟图表获取4小时蜡烛的最高点。

huangapple go评论86阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年8月11日 02:31:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76878458.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定