Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- //@version=6
- indicator(title="ATOM Dominance Index (ARDI MTF)", shorttitle="ARDI", overlay=false, precision=4)
- // === INPUTS ===
- grpSupply = "Supply Settings"
- circSupplyInput = input.int(390934204, "ATOM Circulating Supply", minval=1000000, group=grpSupply)
- // === DATA FETCHING ===
- atomClose = close
- othersClose = request.security("CRYPTOCAP:OTHERS", timeframe.period, close)
- // === CALCULATIONS ===
- atomMarketCap = atomClose * circSupplyInput
- rawRatio = (atomMarketCap / othersClose) * 100
- dominance = rawRatio * 1.52827
- // === AUTOMATIC SMART SCALE BASED ON TIMEFRAME ===
- var float maxRangeLevel = 8.0
- if timeframe.ismonthly or (timeframe.isintraday and timeframe.multiplier >= 43200) // Monthly / 3M
- maxRangeLevel := 8.0
- else if timeframe.isweekly // Weekly
- maxRangeLevel := 4.0
- else // Daily, 4H, etc.
- maxRangeLevel := 1.5
- // Compute fixed median and bottom based on the smart scale
- midRangeLevel = maxRangeLevel / 2.0
- minRangeLevel = 0.0
- // === BANDS PLOTS (Fixed Horizontal Style using Trackprice) ===
- hTop = plot(maxRangeLevel, "Upper Band", color=color.new(#ff5252, 10), style=plot.style_linebr, linewidth=1, trackprice=true, show_last=1)
- hMid = plot(midRangeLevel, "Median", color=color.new(color.gray, 30), style=plot.style_linebr, linewidth=1, trackprice=true, show_last=1)
- hBot = plot(minRangeLevel, "Bottom", color=color.new(#4caf50, 10), style=plot.style_linebr, linewidth=1, trackprice=true, show_last=1)
- // Purple RSI-style background fill
- fill(hTop, hBot, color=color.new(#3f51b5, 91), title="RSI Purple Background")
- // === MAIN PLOTS ===
- // Main Dominance Line (Purple)
- domPlot = plot(dominance, title="ATOM Dominance %", color=color.new(#b388ff, 10), linewidth=2)
- // Signal Moving Average (Yellow)
- maSignal = ta.ema(dominance, 14)
- plot(maSignal, title="Signal MA", color=color.new(#ffd740, 10), linewidth=2)
- // === OVERVALUED VISUAL EFFECTS (Anchored directly to hTop) ===
- overvaluedFillColor = dominance > maxRangeLevel ? color.new(#4caf50, 75) : color.new(color.white, 100)
- fill(domPlot, hTop,
- top_color = overvaluedFillColor,
- bottom_color = color.new(#4caf50, 92),
- title="Overvalued Gradient Fill")
Advertisement
Add Comment
Please, Sign In to add comment