我想同时看到2个不同的叠加层

问题描述 投票:0回答:1

我创建了一个指标,你可以清楚地看到它像这样___the indicator that ive made here但我希望看到我的atr看起来像这样i want to make like that

indicator("Komut dosyam",overlay = true or false)

overlay_numero=input.int(1,title="Overlay Num",options = [0,1],inline="select a number for overlay")

overlaynum(overlay_numero)=>
    ali=if overlay_numero==1
        overlay=false
    else if overlay_numero==0
        overlay=true
    ali 
.....

//none of them couldnt work as of like this
plot(ta.valuewhen(overlaynum(overlay_numero = 1) and plot_string_4=="ATR",source = atr,occurrence=0),color=color.red)
plot(ta.valuewhen(overlaynum(overlay_numero = 1) and plot_string_4=="MFI",source = mfi,occurrence=mfi_value),color=color.aqua)
plot(ta.valuewhen(overlaynum(overlay_numero = 1) and plot_string_4=="CMO",source = cmo,occurrence=0),color=color.silver)
plot(ta.valuewhen(overlaynum(overlay_numero = 1) and plot_string_4=="RSI",source = rsi,occurrence=0),color=color.blue)
plot(ta.valuewhen(overlaynum(overlay_numero = 1) and plot_string_4=="MOM",source = mom,occurrence=0),color=color.lime)
pine-script pine-script-v5 tradingview-api trading algorithmic-trading
1个回答
0
投票

这是不可能的。一个脚本只能用作

overlay=true
overlay=false

如果您想在图表上查看 ATR 值,您可以将其绘制在状态线或数据窗口上。

//@version=5
indicator("My script", overlay=true)

atr_val = ta.atr(14)

plot(atr_val, "ATR", color.red, display=display.data_window + display.status_line)

© www.soinside.com 2019 - 2024. All rights reserved.