【问题标题】:Plotting Previous day high and low (Pinescript)绘制前一天的高点和低点 (Pinescript)
【发布时间】:2020-09-02 20:48:18
【问题描述】:

刚刚学会绘制前一天的高点和低点。它为已完成的会话绘制得很好,但它继续为每根蜡烛的高点和低点绘制(对于当前会话)。我觉得它分散注意力。我使用 5 分钟图表。代码(v4):

1. // Previous day high low
 2. plotDHL = input(title="Plot PDH PDL", type=input.bool, defval=true)
 3. pdh = security(syminfo.tickerid, 'D', high)
 4. pdl = security(syminfo.tickerid, 'D', low)
 5. cDHL = color.new(#f21bf2, 40)
 6. plot(series=plotDHL ? pdh : 0, title = "PDH", style = myStyle, linewidth = 1, color = cDHL)
 7. plot(series=plotDHL ? pdl : 0, title = "PDL", style = myStyle, linewidth = 1, color = cDHL)

【问题讨论】:

    标签: pine-script


    【解决方案1】:

    我不确定我的回答是否实用,但您可以使用:

    a = security(syminfo.tickerid, 'D', high)
    b = 0.
    b := barstate.islast ? b[1] : a
    

    【讨论】:

    • 对不起,我该如何使用它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-21
    • 2022-07-26
    • 2022-12-03
    • 1970-01-01
    相关资源
    最近更新 更多