专家们,
我的第一个PineScript图有一个问题,那就是RSI图比价格图大得多(见屏幕截图)。你知道我怎么才能把RSI图移到底部让它变小吗?

//@version=5
strategy("Simple MA Strategy", overlay=true, initial_capital=10000)
// Date range
startDate = timestamp(2000, 01, 01, 0, 0, 0)
// Define inputs
ema1Value = input(title="EMA 1", defval=50)
ema1Source = input(title="EMA 1 Source", defval=close)
ema2Value = input(title="EMA 2",defval=200)
ema2Source = input(title="EMA 2 Source", defval=close)
rsiSource = input(title="RSI Source", defval=close)
rsiLength = input(title="RSI Length",defval=14)
rsiOverboughtLevel = input(title="RSI Overbought Level", defval=70)
rsiOversoldLevel = input(title="RSI Oversold Level", defval=30)
// Indicators
ema1 = ta.ema(ema1Source, ema1Value)
ema2= ta.ema(ema2Source, ema2Value)
rsi = ta.rsi(rsiSource,14)
rsiValue = ta.rsi(rsiSource, rsiLength)
// Rules
ema_crossover = ta.crossover(ema1, ema2)
ema_crossunder = ta.crossunder(ema1, ema2)
isRsiOverbought = rsiValue >= rsiOverboughtLevel
isRsiOversold = rsiValue <= rsiOversoldLevel
// Plot indicators & levels
plot(ema1, color=color.green,linewidth = 1)
plot(ema2, color=color.fuchsia,linewidth = 1)
plot(rsi, "RSI", color=color.rgb(0, 18, 212))
rsiOversoldLine = hline(rsiOverboughtLevel, "OerSold", color=#C0C0C0)
rsiOverboughtLine = hline(rsiOversoldLevel, "OverBought", color=#C0C0C0)
fill(rsiOversoldLine, rsiOverboughtLine, color=color.rgb(147, 163, 208, 86), title="Background")发布于 2022-10-09 21:22:36
您应该使用适当的overlay标志设置为false,从而在不同的面板中绘制RSI。
strategy("Simple MA Strategy", overlay=false, initial_capital=10000)https://stackoverflow.com/questions/74008435
复制相似问题