Hline 未在指标内绘制。
所有条件都满足。
什么是简单的浮动?我该如何解决这个问题
//@version=5
indicator(title='RSI_RS horizontal', shorttitle='RSI_RS horizontal', overlay=false, format=format.price)
rsi = ta.rsi(close, 14)
//RSI PLOT
plot(rsi, title='RSI', style=plot.style_line, linewidth=1, color=color.new(color.black, 0))
//====================================================================================
//HORIZONTAL MOVING LINES
//shortma = input(3, minval=2,type=input.integer, title="RSI MINI LENGTH")
horizontal = input.string(title='HORIZONTAL MOVING LINES TYPE', defval='60/40', options=['60/40', '80/40', '60/20', '80/20'])
var float top_h_line = 0.0
var float bottom_h_line = 0.0
if horizontal == '60/40'
top_h_line := 60
bottom_h_line := 40
else
if horizontal == '80/40'
top_h_line := 80
bottom_h_line := 40
else
if horizontal == '80/20'
top_h_line := 60
bottom_h_line := 20
else
top_h_line := 80
bottom_h_line := 20
hline(top_h_line)
//====================================================================================
错误: 第 45 行:无法使用参数 'price'='top_h_line' 调用 'hline'。使用了“简单浮点”类型的参数,但需要“输入浮点”