简体   繁体   English

如何在 pinescript 中使用偏移量

[英]How to use offset in pinescript

How to make a delay for one candle so that the bar starts with open.如何延迟一根蜡烛,以便条形图从开盘开始。 Standard delay cannot do this.标准延迟不能做到这一点。

在此处输入图像描述

在此处输入图像描述

I tried changing the timeframe, using a delay but none of that helped.我尝试使用延迟更改时间范围,但没有任何帮助。

//@version=2 
study("MTF", overlay=true)
tim=input('5')
out1 = security(tickerid, tim, open)
out2 = security(tickerid, tim, close)
plot(out1,color=red,linewidth = 4, transp = 0)
plot(out2,color=green, linewidth = 4, transp = 0)

Answering EXACTLY to your question:准确回答你的问题:
For 1m chart, and 5m HTF, the offset will be -5.对于 1m 图表和 5m HTF,偏移量将为 -5。 To 15mHTF: -15.至 15mHTF:-15。 Etc ETC

For this to happen, you must migrate your code to v5为此,您必须将代码迁移到 v5
And use technique of No-Repainting并使用No-Repainting技术

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM