Guest User

Untitled

a guest
Jul 20th, 2026
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TypeScript 2.29 KB | Cryptocurrency | 0 0
  1. // This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. //@version=6
  3. indicator(title="ATOM Dominance Index (ARDI MTF)", shorttitle="ARDI", overlay=false, precision=4)
  4.  
  5. // === INPUTS ===
  6. grpSupply = "Supply Settings"
  7. circSupplyInput = input.int(390934204, "ATOM Circulating Supply", minval=1000000, group=grpSupply)
  8.  
  9. // === DATA FETCHING ===
  10. atomClose   = close
  11. othersClose = request.security("CRYPTOCAP:OTHERS", timeframe.period, close)
  12.  
  13. // === CALCULATIONS ===
  14. atomMarketCap = atomClose * circSupplyInput
  15. rawRatio      = (atomMarketCap / othersClose) * 100
  16. dominance     = rawRatio * 1.52827
  17.  
  18. // === AUTOMATIC SMART SCALE BASED ON TIMEFRAME ===
  19. var float maxRangeLevel = 8.0
  20.  
  21. if timeframe.ismonthly or (timeframe.isintraday and timeframe.multiplier >= 43200) // Monthly / 3M
  22.     maxRangeLevel := 8.0
  23. else if timeframe.isweekly // Weekly
  24.     maxRangeLevel := 4.0
  25. else // Daily, 4H, etc.
  26.     maxRangeLevel := 1.5
  27.  
  28. // Compute fixed median and bottom based on the smart scale
  29. midRangeLevel = maxRangeLevel / 2.0
  30. minRangeLevel = 0.0
  31.  
  32. // === BANDS PLOTS (Fixed Horizontal Style using Trackprice) ===
  33. hTop = plot(maxRangeLevel, "Upper Band", color=color.new(#ff5252, 10), style=plot.style_linebr, linewidth=1, trackprice=true, show_last=1)
  34. hMid = plot(midRangeLevel, "Median", color=color.new(color.gray, 30), style=plot.style_linebr, linewidth=1, trackprice=true, show_last=1)
  35. hBot = plot(minRangeLevel, "Bottom", color=color.new(#4caf50, 10), style=plot.style_linebr, linewidth=1, trackprice=true, show_last=1)
  36.  
  37. // Purple RSI-style background fill
  38. fill(hTop, hBot, color=color.new(#3f51b5, 91), title="RSI Purple Background")
  39.  
  40. // === MAIN PLOTS ===
  41. // Main Dominance Line (Purple)
  42. domPlot = plot(dominance, title="ATOM Dominance %", color=color.new(#b388ff, 10), linewidth=2)
  43.  
  44. // Signal Moving Average (Yellow)
  45. maSignal = ta.ema(dominance, 14)
  46. plot(maSignal, title="Signal MA", color=color.new(#ffd740, 10), linewidth=2)
  47.  
  48. // === OVERVALUED VISUAL EFFECTS (Anchored directly to hTop) ===
  49. overvaluedFillColor = dominance > maxRangeLevel ? color.new(#4caf50, 75) : color.new(color.white, 100)
  50.  
  51. fill(domPlot, hTop,
  52.      top_color = overvaluedFillColor,
  53.      bottom_color = color.new(#4caf50, 92),
  54.      title="Overvalued Gradient Fill")
  55.  
Advertisement
Add Comment
Please, Sign In to add comment