內外盤比

//version=5
indicator("內外盤比", overlay=false)

// 計算外盤和內盤成交量
buyVolume = close > open ? volume : 0
sellVolume = close < open ? volume : 0

// 計算內外盤比
innerOuterRatio = buyVolume / (sellVolume + buyVolume)

// 顯示結果
plot(innerOuterRatio, title="內外盤比", color=color.blue, linewidth=2)
hline(1, "1:1", color=color.red)

免責聲明