簡體   English   中英

卷松腳本 v4

[英]Volume pine script v4

我正在嘗試編寫一個代碼,該代碼將在條形上方顯示 label,其體積比之前的體積大 20%。 我試過這些解決方案:

a = volume / volume [1]
if a> = 1
     label.new (int (a), close, text = "LONG", color = color.red, style = label.style_xcross, textcolor = color.white, size = size.tiny)

和這個

max_bars_back (time, 100)
a = volume [1] * 100 / volume
if a> = 2
     label.new (int (a), close, text = "LONG", color = color.red, style = label.style_xcross, textcolor = color.white, size = size.tiny)

像這樣:

a = volume [1] * 100 / volume
if a> = 2
     label.new (int (a), close, text = "LONG", color = color.red, style = label.style_xcross, textcolor = color.white, size = size.tiny)

幫我編寫一個代碼,在條形上方顯示一個 label,其體積比之前的體積大 20%,我嘗試這樣做

試試這個簡單的腳本,它應該根據您的條件繪制 label:

//@version=4
study("My Script", overlay=true)
// volume
if volume > volume[1] * 1.2
    label.new(bar_index, high, "V > V[1] more than 1.2 times\n current volume is " + tostring(volume) + "\nprevious volume is " + tostring(volume[1]))

暫無
暫無

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

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