【问题标题】:Plot a value also for the last (current) bar也为最后一个(当前)柱绘制一个值
【发布时间】:2020-06-17 10:24:25
【问题描述】:

我正在绘制一条每个月都会改变其值的线:

lastmonth_high = security(syminfo.tickerid, "M", high) 
plot(lastmonth_high, color=lastmonth_high != lastmonth_high[1] ? na : color.blue, style=plot.style_line, linewidth=3)

这样,它不会在实际柱上绘制任何值。 如何将第一行向右延伸?

【问题讨论】:

    标签: plot pine-script


    【解决方案1】:

    试试这个

    lastmonth_high = security(syminfo.tickerid, "M", high, lookahead = barmerge.lookahead_on)
    plot(lastmonth_high, color=lastmonth_high != lastmonth_high[1] ? na : color.blue, style=plot.style_line, linewidth=3)
    

    【讨论】:

    • 谢谢!我测试了它...它一直绘制到最后一个条形图,但是当前月份的整条线介于上个月的值和应该在的位置之间...
    • 你的意思是lastmonth_high 是最后一个关闭/确认的月度柱的高位吗?
    • 是的,它应该简单地在下个月绘制上个月的值!而且我希望在当前栏也有情节......这个值总是和我现在在倒数第二个栏看到的一样
    • 也许你需要lastmonth_high = security(syminfo.tickerid, "M", high[1], lookahead = barmerge.lookahead_on)
    猜你喜欢
    • 2022-11-24
    • 2012-12-06
    • 1970-01-01
    • 2021-11-23
    • 1970-01-01
    • 2014-07-01
    • 1970-01-01
    • 2015-07-02
    • 1970-01-01
    相关资源
    最近更新 更多