本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
indicator("Altcoin Open Interest (OI) Dominance (Coinalyze, ex-TradFi)", shorttitle="Alt OI Dom", precision=1)
warnLvl = input.float(38.0, "Warning level %", step=0.5)
T0 = 1605052800000
var vals = array.new<float>()
if barstate.isfirst
for s in str.split("100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00", ",")
vals.push(str.tonumber(s))
for s in str.split("100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00", ",")
vals.push(str.tonumber(s))
for s in str.split("100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00", ",")
vals.push(str.tonumber(s))
for s in str.split("100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,100.00,28.34,29.83,32.07,26.58,26.36,26.94,26.68,27.08,27.04,27.66,27.90,26.18,26.69,27.15,26.57,26.27,25.67,25.62,26.56,27.20,27.35,28.04,28.54,27.19,28.97,29.34,28.74,30.21,30.34,30.06,29.68,29.54,28.81,28.73,29.41,29.47,29.50,28.97,28.92,27.19,28.11,27.92,29.00,29.30,29.57,27.53,26.44,26.93,25.81,26.02,26.30,26.53,25.84,26.10,25.79,25.48,26.29,26.40,25.70,26.70,25.28,25.13,25.56,27.13,26.81,27.38,28.52,29.12,28.78,30.04,29.70,29.45,29.11,29.50,28.11,25.34,25.57,25.51,25.07,25.44,26.33,25.72,25.49,25.91,26.92,27.09,25.67,25.20,26.62,27.64,27.85,28.01,28.18,28.67,28.36,28.01,27.87,27.15,27.31,27.77,28.22,29.02,29.60,28.54,28.31,28.53,28.83,28.58,28.38,27.10,26.42,27.16,25.91,26.29,27.03,26.31,26.84,26.99,27.13,27.06,27.43,27.63,28.14,27.39,26.48,26.42,26.91,27.56,27.71,27.90,28.47,28.74,28.51,28.86,29.33,29.63,28.22,27.65,28.39,28.03,28.14,29.44,29.49,28.18,28.05,26.64,26.85", ",")
vals.push(str.tonumber(s))
for s in str.split("28.66,28.60,29.38,30.18,28.73,30.87,31.01,31.79,31.93,31.25,30.12,30.71,30.52,30.73,31.65,31.57,30.56,30.15,31.39,30.74,28.61,29.02,29.94,29.74,29.31,29.43,29.99,29.15,30.08,30.36,30.75,31.30,30.57,30.58,30.86,30.17,29.54,30.04,30.30,29.68,30.76,30.24,29.69,29.25,29.72,30.09,30.37,29.43,30.17,30.49,31.76,33.53,31.15,31.34,29.88,29.58,28.71,28.18,27.78,27.04,27.91,27.64,28.95,29.67,29.87,29.68,29.59,29.98,29.87,30.42,30.20,30.49,30.26,31.37,30.38,30.72,30.96,31.10,30.89,30.99,29.78,30.23,29.10,29.19,31.42,31.80,32.87,32.67,33.36,31.41,30.71,30.39,30.51,30.13,30.06,30.15,30.40,30.20,30.29,30.50,30.47,30.29,30.10,30.40,30.42,29.41,30.16,30.50,27.81,28.12,28.71,27.86,28.97,28.88,29.17,29.52,29.99,30.47,30.41,30.83,30.78,30.38,30.70,30.12,29.54,29.89,30.22,30.65,29.77,29.59,29.74,29.82,30.21,30.51,30.78,31.48,28.26,29.29,29.48,29.52,29.92,24.09,24.40,24.30,24.13,24.18,24.70,24.69,25.35,24.92,24.84,23.98,24.20,23.88,24.68,24.65,24.74,24.99,25.37,24.32,25.29,26.62,27.31,28.03,27.16,27.31,26.51,27.05,27.76,28.16,28.14,27.38,28.04,27.57,28.40,29.38,30.42,30.30,30.39,29.77,30.70,30.71,31.15,30.27,30.72,28.93,29.99,30.09,30.24,30.41,30.88,30.79,30.36,30.86,30.17,30.16,29.86,30.59,30.61,29.71", ",")
vals.push(str.tonumber(s))
for s in str.split("28.51,29.37,29.61,30.36,30.92,30.45,30.79,28.37,26.63,26.88,28.11,29.18,28.89,28.67,29.23,29.70,29.83,29.81,30.10,30.31,29.96,28.57,29.35,30.11,29.67,29.48,29.69,29.68,29.54,29.63,29.46,29.38,29.55,29.19,28.12,28.39,28.68,28.57,29.85,29.71,28.84,28.67,28.84,29.46,29.15,29.72,29.75,29.88,30.15,30.31,30.65,29.52,30.51,30.78,31.15,30.60,30.08,29.34,29.11,29.34,29.45,29.38,28.39,28.46,28.14,27.90,28.09,28.54,28.22,28.91,28.50,28.81,28.69,28.87,29.33,30.02,30.67,30.30,30.88,30.67,30.41,30.84,30.81,31.76,31.42,31.59,31.57,31.90,32.44,32.24,34.11,33.27,34.00,31.07,32.90,33.58,33.77,32.15,33.18,33.60,33.49,33.79,32.95,33.38,32.33,31.76,31.97,32.17,32.50,33.90,33.48,32.64,32.70,32.96,33.38,32.72,34.40,34.15,33.97,33.83,33.41,33.96,36.15,35.70,36.28,35.20,35.95,35.48,36.91,36.62,37.47,36.65,36.12,36.07,36.71,38.07,38.53,39.69,39.71,41.21,39.87,39.25,39.37,40.18,40.21,39.86,40.06,39.09,36.36,36.62,36.20,35.34,33.77,33.30,33.12,33.93,34.32,33.81,34.54,34.12,35.18,35.50,36.39,34.88,35.01,35.60,35.41,34.92,34.54,34.83,34.53,34.68,35.52,35.68,36.47,36.51,36.05,36.51,37.31,37.20,37.12,36.93,36.34,36.47,36.15,37.22,37.07,36.71,35.89,36.26,36.54,36.76,36.76,36.68,37.31,37.94,36.81,36.02,36.97,37.30", ",")
vals.push(str.tonumber(s))
for s in str.split("37.96,37.69,37.85,38.66,38.27,39.06,40.84,42.55,41.54,40.39,38.04,38.73,39.87,40.04,41.30,40.02,39.71,39.57,40.45,40.27,40.19,39.25,39.61,38.47,37.94,38.44,38.86,39.11,39.28,39.62,39.47,40.14,40.02,40.93,41.75,41.52,41.88,40.45,40.09,39.46,39.52,39.51,39.90,39.86,39.48,38.98,39.44,39.24,33.97,31.58,31.85,31.23,31.16,30.70,31.17,31.69,32.95,32.80,33.17,33.44,32.42,32.93,32.48,31.78,31.81,31.75,30.71,31.83,32.60,32.49,32.80,33.08,33.49,33.27,33.18,34.01,33.22,33.48,33.57,33.26,33.25,33.17,33.93,33.92,34.05,33.67,33.52,33.39,33.26,33.00,33.22,33.67,33.23,33.88,33.97,33.31,33.20,33.17,33.47,33.50,33.21,33.91,33.99,33.97,31.06,30.58,30.64,29.69,29.46,30.40,29.70,29.29,29.05,29.29,28.50,26.96,26.83,27.03,27.12,27.42,27.17,28.17,28.71,28.67,29.11,28.28,28.06,28.12,28.57,28.88,27.80,27.14,27.14,28.10,27.15,27.92,27.66,27.93,27.30,27.78,27.63,27.73,28.70,28.96,29.26,29.14,29.23,29.90,30.78,30.04,29.43,29.51,29.03,29.85,29.55,29.08,28.96,28.81,28.59,27.98,27.09,26.65,26.43,26.75,27.65,27.92,28.96,29.02,29.35,28.06,28.99,28.48,28.27,27.92,27.69,28.11,28.08,29.02,29.31,28.93,29.61,29.94,30.54,29.93,29.57,29.28,29.02,28.78,28.90,28.70,28.22,28.52,28.07,28.84,28.72,28.22,28.72,28.97,29.24,29.63", ",")
vals.push(str.tonumber(s))
for s in str.split("29.46,30.13,29.78,30.09,29.85,29.79,29.72,30.12,30.46,31.05,31.60,30.94,31.47,32.32,32.19,33.32,34.08,34.31,34.79,33.73,32.76,32.18,31.24,31.96,31.95,32.73,33.10,32.63,32.05,32.64,33.28,33.79,34.32,33.99,33.26,32.55,32.55,32.72,33.39,33.98,33.86,33.86,34.05,34.48,32.65,33.02,33.18,32.08,32.42,32.15,31.38,31.70,31.40,30.76,30.17,31.26,32.25,32.69,32.95,34.57,35.56,36.44,36.71,37.00,36.35,38.06,38.65,39.02,38.60,38.34,35.82,36.59,38.03,38.68,39.12,37.64,37.67,37.55,38.27,39.82,40.52,41.64,42.79,43.44,42.13,42.88,43.56,44.54,44.46,39.25,38.77,39.22,39.60,39.85,38.92,38.12,37.86,38.20,36.58,35.00,35.48,34.58,34.79,35.67,36.04,35.62,34.81,34.64,35.17,34.52,34.45,34.64,35.38,35.85,37.25,37.65,37.48,36.63,35.12,34.48,33.99,34.50,35.27,35.01,35.32,36.21,38.09,38.45,38.56,39.53,37.55,36.09,36.44,37.02,36.43,36.31,36.88,36.53,35.38,34.78,34.76,35.49,35.21,34.23,32.32,31.12,30.46,30.15,29.95,30.10,30.85,30.64,30.71,30.64,31.14,31.25,32.02,31.70,31.98,31.13,30.42,31.07,30.76,29.71,30.25,29.60,28.05,28.47,30.14,30.19,31.87,31.59,33.11,31.51,31.38,31.00,31.03,31.31,31.05,30.21,30.08,30.52,30.74,30.78,30.97,31.27,30.95,31.02,31.55,31.33,31.99,32.03,32.28,32.18,32.35,33.10,33.16,33.59,32.06,31.80", ",")
vals.push(str.tonumber(s))
for s in str.split("32.06,31.95,31.30,31.15,31.54,31.40,31.44,30.09,30.01,29.87,30.37,30.72,30.98,31.28,30.95,30.91,30.46,31.05,31.28,31.70,32.25,32.18,31.24,31.29,31.93,32.26,31.80,32.51,32.21,32.51,32.17,32.42,31.42,31.76,31.64,31.80,31.78,31.38,31.39,32.88,34.56,35.39,34.22,34.97,35.75,35.03,33.64,33.15,32.83,33.26,31.69,31.57,31.53,32.84,32.07,32.25,32.35,31.55,31.40,31.26,30.96,30.35,29.96,30.11,30.15,30.28,30.00,29.61,29.67,30.12,30.42,30.29,30.75,30.48,30.50,30.68,30.17,30.26,29.90,29.72,30.06,29.84,29.15,28.94,28.96,30.08,29.66,29.22,28.86,29.57,30.76,31.08,30.81,30.28,30.07,30.00,29.96,29.99,30.25,30.28,30.23,30.26,31.47,31.51,31.73,31.75,31.54,32.07,32.92,33.41,33.44,33.85,34.35,35.10,35.91,34.00,32.66,32.65,33.30,33.49,32.62,32.22,31.41,30.95,30.43,30.30,30.94,31.60,31.23,31.66,31.84,31.82,31.90,31.92,31.01,31.61,31.86,30.66,30.89,30.95,31.29,31.04,30.38,31.24,30.58,31.14,31.59,31.42,31.07,31.55,32.11,33.08,32.33,32.60,32.45,32.05,32.60,32.79,32.31,32.84,33.04,33.82,34.97,34.71,35.59,35.80,36.00,36.79,36.24,35.76,35.84,36.61,37.41,36.35,36.94,36.80,35.60,35.51,35.85,35.24,35.78,36.07,36.17,35.54,35.54,35.55,35.86,35.97,35.62,35.26,35.88,35.99,36.21,35.20,29.93,28.86,28.66,29.25,28.55,28.36", ",")
vals.push(str.tonumber(s))
for s in str.split("27.55,27.37,27.38,27.39,27.42,27.57,28.00,28.78,28.61,28.99,29.16,29.06,29.75,30.00,28.89,29.42,29.68,29.81,28.18,28.42,28.30,28.39,29.79,29.34,29.14,29.36,28.58,28.38,27.72,28.14,28.21,28.09,27.64,28.50,28.18,28.03,27.99,27.56,27.84,28.38,29.19,28.96,28.63,28.67,28.61,28.25,28.03,28.35,28.49,28.16,28.08,28.31,27.86,28.02,27.91,27.53,27.48,27.76,27.89,27.52,27.39,27.67,27.48,26.74,27.07,27.30,27.11,27.05,26.59,27.05,26.99,27.24,28.21,28.17,27.68,27.64,27.47,27.97,28.03,28.48,28.88,29.25,29.48,28.80,28.82,28.99,29.04,29.05,29.50,29.74,29.44,29.31,29.42,29.26,28.87,28.38,27.54,27.98,27.67,28.31,28.66,28.08,28.59,28.83,28.92,27.90,28.48,29.27,30.26,30.90,31.04,30.87,30.27,30.78,31.00,30.90,30.71,31.10,31.55,31.82,31.92,33.17,32.96,33.16,32.57,32.31,32.01,32.40,32.15,32.08,31.74,31.60,32.01,31.79,31.90,32.50,32.39,31.28,31.85,29.79,30.80,31.05,31.10,31.28,31.49,31.13,31.08,30.97,31.31,31.34,31.31,30.62,30.47,30.64,30.28,30.66,30.74,30.65,31.00,31.03,30.95,30.45,29.94,30.11,30.08,30.28,29.98,29.86,30.43,30.67,30.66,30.21,29.95,30.43,29.75,30.01,29.60,29.52,30.55,30.14,29.22,29.90,31.68,29.78,29.73,29.63,29.82,29.95,28.41,29.92,30.50,30.41,30.33,30.10,30.46,30.32,30.46,29.81,30.24,29.91", ",")
vals.push(str.tonumber(s))
for s in str.split("29.38,29.82,30.83,30.72,32.41,32.42,32.79,32.63,31.50,30.68,31.32,30.58,29.97,30.64,30.94,31.08,32.21,33.00,31.78,32.53,33.16,33.15,32.51,31.51,31.21,32.15,32.99,33.52,33.39,33.18,34.66,32.99,32.14,31.91,32.75,32.74,32.03,31.28,31.87,31.95,32.29,32.43,32.53,33.42,33.79,33.18,33.03,33.47,33.17,32.98,32.93,32.52,32.17,32.95,32.61,32.63,33.30,32.53,33.24,32.75,33.42,33.46,33.49,33.33,33.17,32.59,32.90,32.49,32.33,32.46,31.56,31.27,31.60,31.34,31.55,31.30,31.45,31.45,30.82,31.17,30.85,30.74,30.74,30.95,30.37,30.22,30.11,29.89,29.75,29.88,30.13,30.12,30.10,30.17,30.36,30.49,31.10,31.18,31.11,30.98,30.95,31.09,30.56,30.60,30.83,30.95,31.06,31.22,31.62,32.92,33.60,34.29,33.47,33.18,33.90,34.72,33.88,34.18,33.60,33.44,33.15,33.13,33.73,34.45,35.47,36.34,35.72,35.82,35.00,33.44,33.61,33.70,33.08,33.68,32.91,33.85,35.50,35.66,35.60,35.99,35.74,36.82,36.32,37.34,38.65,38.94,39.27,38.12,37.92,38.05,37.18,36.83,37.27,37.55,38.04,37.29,36.74,36.42", ",")
vals.push(str.tonumber(s))
int idx = int(math.floor((time - T0) / 86400000.0))
float v = idx >= 0 and idx < vals.size() ? vals.get(idx) : na
v := v >= 99 ? na : v
bool hot = not na(v) and v >= warnLvl
plot(v, "Others OI dominance", color = hot ? color.red : color.orange, linewidth = 2)
hline(warnLvl, "Warning level", color = color.gray, linestyle = hline.style_dashed)
bgcolor(hot ? color.new(color.red, 85) : na, title = "Above warning level")
float hi3 = ta.highest(v, 3)
bool flush = not na(v) and hi3 - v >= 4
plotshape(flush and not flush[1], "Flush", shape.triangledown, location.top, color.red, size = size.small)
alertcondition(hot and not hot[1], "Others OI warning", "Others OI dominance above warning level")
alertcondition(flush and not flush[1], "Alt leverage flush", "Others OI dominance dropped 4+ pts in 3 days")