Pine script 简易循环RSI指示器

Pine script 简易循环RSI指示器,pine-script,Pine Script,我为noob的问题提前道歉,但我无法用我的生命去理解它,我知道这很简单。我想做一个指标,一个指标,非常简单。我在看RSI,我想知道x回望,有多少次它在50线以上或以下关闭。如果它在上面关闭,则向运行总和中添加1,如果它在下面关闭,则从运行总和中减去1 我能收集到的最好信息基本上是: //@version=4 study("RSI Trends") //Get RSI rsiValue = rsi(close,14) //Calculate days above and bel

我为noob的问题提前道歉,但我无法用我的生命去理解它,我知道这很简单。我想做一个指标,一个指标,非常简单。我在看RSI,我想知道x回望,有多少次它在50线以上或以下关闭。如果它在上面关闭,则向运行总和中添加1,如果它在下面关闭,则从运行总和中减去1

我能收集到的最好信息基本上是:

//@version=4
study("RSI Trends")
//Get RSI
rsiValue = rsi(close,14)
//Calculate days above and below RSI 50
green_candles = rsiValue >=50 ? 1 : 0
red_candles = rsiValue <=50 ? -1 :0
//Sum the last 14 days to get where RSI has been favoring
thermometer = sum(green_candles + red_candles, 2)
//Plot as columns
plot(thermometer, style = plot.style_columns)
/@version=4
研究(“RSI趋势”)
//患RSI
rsi值=rsi(关闭,14)
//计算RSI 50以上和以下的天数
绿色蜡烛=rsiValue>=50?1 : 0
红色烛光=红色值