簡體   English   中英

Pine V5 類型問題:在 tradingview 圖表上顯示 RSI 值

[英]Pine V5 type issues : Display RSI value on tradingview chart

我正在嘗試在交易視圖中的每個柱上方顯示 RSI 值。 我無法這樣做,因為無論我嘗試什么,我都會收到以下錯誤。

無法使用參數 'text'='vt_rsi_str' 調用 'plotshape'。 使用了“系列字符串”類型的參數,但應使用“常量字符串”

我顯然是在解決這個問題,但我覺得顯示 RSI 值應該是可能的,不是嗎?

我嘗試過的最新掌握的稻草語法如下。 任何建議將不勝感激!

vt_rsi = ta.rsi(close,14)
vt_rsi_str = str.format("{0,number,#}", str.tostring(vt_rsi[0]))
plotshape(vt_rsi_up, style=shape.arrowup, color=#1848cc, title="RSI Up", location=location.top, text=vt_rsi_str)

plot()函數不支持這一點。 在此處查看我的答案以獲取更多詳細信息。

但是,您可以改用label

//@version=5
indicator("My Script", overlay=true)
vt_rsi = ta.rsi(close,14)
vt_rsi_str = str.format("{0,number,#.##}", vt_rsi)
label1 = label.new(bar_index, high, text=vt_rsi_str, style=label.style_triangledown, size=size.tiny, color=#1848cc, textcolor=#1848cc)
label.set_xloc(label1, time, xloc.bar_time)
label.set_y(label1, high)
label.set_text(label1, vt_rsi_str)

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM