【trandingview OI 彩色指标】利于分析多头空头操作方向
//@version=5indicator(title = "OI", shorttitle = 'OI', format = format.volume, overlay = true)
// Parts
var string Source = syminfo.tickerid
var string OpenInterest = "_OI"
var string Formula = Source + OpenInterest
// Candles
Open = request.security(Formula, timeframe.period, open)
High = request.security(Formula, timeframe.period, high)
Low = request.security(Formula, timeframe.period, low)
Close = request.security(Formula, timeframe.period, close)
// 计算柱体的大小
candleSize =close -open
// 计算柱体大小的均值
avgCandleSize = ta.sma(candleSize, 12)
// 定义颜色条件函数
getColor() =>
if ( candleSize >= 0 and Open < Close)
color.lime
else if ( candleSize >= 0 and Open > Close)
color.maroon
else if ( candleSize < 0 and Open > Close)
color.red
else if ( candleSize < 0 and Open < Close)
color.teal
else
color.gray
// 获取颜色
barColor = getColor()
// Plot
plotcandle(Open, High, Low, Close,
color = Open < Close ? color.new(#d1d4dc, 100) : barColor,
wickcolor = barColor,
bordercolor = barColor,
title = 'Open Interest')
高亮绿为开多, 高亮红平多
深绿为开空,紫红平空
看不太懂,详细说说 这个指标怎么获取???
如何下载啊,看不了链接 zhu235689 发表于 2024-7-19 09:12
如何下载啊,看不了链接
TV 自带的,下载TV就好了 thk you sister 有用过的吗 玩币子的都不玩啊 高浮雕广泛广泛大锅饭广泛的
页:
[1]