【问题标题】:convert series to fix value pine script将系列转换为固定值松脚本
【发布时间】:2021-05-09 13:29:22
【问题描述】:

我怎样才能得到一个系列的特殊值来修复值

//@version=4
study("My Script", overlay = true)

float lastclose = close[1] 
// I want get close last bar (11.00 am 9/5/2021) = 1.21632(EURUSD) , I don't want lastclose is series

plot(lastclose)

// I want this plot
plot(1.21632)

你可以在我的图片中看到,红线是我想要的。

https://www.tradingview.com/x/DK0Fsdpj/

enter image description here

【问题讨论】:

    标签: series pine-script


    【解决方案1】:

    如果只是剧情的话。

    plot(close, color=color.red, linewidth=4, show_last=1, trackprice=true)
    

    这会隐藏绘图并使用水平虚线来跟踪级别。如果您想要更早的收盘价,您可以替换 close[1] 或类似名称。如果您不想要虚线,请使用line.new() 和其他线条函数来管理和更新线条图,并将扩展设置为两者。

    【讨论】:

    • 谢谢,这也是我需要的。但是你知道我有什么方法可以接近[1]来修复浮动吗?
    猜你喜欢
    • 2019-06-26
    • 1970-01-01
    • 1970-01-01
    • 2020-03-24
    • 2017-10-25
    • 1970-01-01
    • 2016-09-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多