当我使用 1 分钟时,是否可以使我的指标 运行 在 30 秒图表上?

Is it possible to make my indicator run on 30 second chart when I am using the 1 minute?

我正在尝试让我的指标在使用 1 分钟图表时显示 30 秒图表中的值。这可能吗?

indicator("Double RSI", timeframe="")
lengthRSIfast = input.int(2, minval=1,title="RSI Fast")
lengthRSIslow = input.int(14, minval=1,title="RSI Slow")
overSold =  10 
overBought = 90 
src = input(close, title="Source")
rsifast = ta.rsi(src, lengthRSIfast)
rsislow = ta.rsi(src, lengthRSIslow)

plot(rsifast,color=color.green)
plot(rsislow,color=color.red)

signal = ta.cross(rsifast,rsislow)?rsislow:na
signalcolor= rsifast>rsislow?color.green:color.red
plot(signal,color=signalcolor,style=plot.style_circles,linewidth=2)
os=hline(overSold)
ob=hline(overBought)

alertcondition(signal, title="DubRSi cross")

不,这是不可能的。可以从较低的时间范围请求数据,但是不建议这样做,因为会丢失一些数据。

security function was designed to request data of a timeframe higher than the current chart timeframe. On a 60 minutes chart, this would mean requesting 240, D, W, or any higher timeframe.

It is not recommended to request data of a timeframe lower that the current chart timeframe, for example 1 minute data from a 5 minutes chart. The main problem with such a case is that some part of a 1 minute data will be inevitably lost, as it’s impossible to display it on a 5 minutes chart and not to break the time axis. In such cases the behavior of security can be rather unexpected.

您可以阅读 this 了解更多详情。

尝试security_lower_tf with timeframe“30S”。