← Selected work
MARKET ANALYTICS / TRADINGVIEW / PACKAGE STUDY
BTC & Altcoins Trend Indicator

Multi-timeframe BTC dominance and altcoin behavior in Pine Script v6.

A TradingView Pine Script v6 overlay indicator analyzing Bitcoin price and EMA trends alongside CRYPTOCAP:BTC.D dominance across 8 timeframes and 4 exchanges to map relative altcoin momentum.

Pine Script v6TradingViewMulti-TimeframeBTC DominanceMPL 2.0

Published TradingView Pine Script v6 overlay indicator. Source code and multi-timeframe matrix verified on GitHub and TradingView.

PACKAGE ENGINEERING

Mapping Bitcoin trend and BTC dominance into relative altcoin behavior.

Analyzing altcoin markets in isolation misses the two macro variables that drive most crypto liquidity rotation: Bitcoin's own directional trend and Bitcoin Dominance (CRYPTOCAP:BTC.D).

Built in TradingView Pine Script v6, the BTC & Altcoins Trend Indicator evaluates both BTCUSDT and CRYPTOCAP:BTC.D simultaneously across eight timeframes—1M, 1W, 1D, 4H, 1H, 15MIN, 5MIN, and 1MIN—and displays a configurable overlay matrix directly on any chart.

Traders can switch between raw close-over-close trend detection (Mode 1) and EMA alignment mode (Mode 2) with up to four customizable EMAs (20, 50, 100, 200) and one SMA (200), complete with optional forward projection lines, chart background cues, and selectable Binance, Bybit, Coinbase, or Kraken feeds.

LANGUAGEPine Script v6 (overlay)
TIMEFRAMES8 Periods (1M → 1MIN)
DOMINANCE FEEDCRYPTOCAP:BTC.D
EXCHANGESBybit, Binance, Coinbase, Kraken
TREND MODESMode 1 (Close) / Mode 2 (EMA)
MOVING AVERAGES4 EMAs + 1 SMA
TRADINGVIEW IDscript/jgwMdlN7
LICENSEMPL 2.0 (Educational)
QUICK START & INTEGRATION

Add directly in TradingView or paste script.pine.

Written in Pine Script v6 (//@version=6, overlay=true) under the Mozilla Public License 2.0 for educational multi-timeframe BTC and altcoin analysis.

script.pine — Pine Script v6 Indicator & Behavior MatrixPINE SCRIPT V6 • MPL 2.0
TradingView Setup & Exchanges
//@version=6
indicator("Indicador de Tendências do BTC e Altcoins", overlay=true)

exchange = input.string("BYBIT",
  options=["BINANCE", "BYBIT", "COINBASE", "KRAKEN"])
btc_usd = exchange + ":BTCUSDT"
btc_dominance = "CRYPTOCAP:BTC.D"
script.pine (get_behavior matrix)
// BTC vs. Altcoin relative momentum matrix
if (btc_trend == "Subindo" and btc_dominance_trend == "Subindo")
    altcoins := "1x up"
    btc      := "2x up"
else if (btc_trend == "Subindo" and btc_dominance_trend == "Caindo")
    altcoins := "2x up"
    btc      := "1x up"
else if (btc_trend == "Caindo" and btc_dominance_trend == "Subindo")
    altcoins := "2x down"
    btc      := "1x down"
else if (btc_trend == "Caindo" and btc_dominance_trend == "Caindo")
    altcoins := "1x down"
    btc      := "2x down"
01. Dual-Signal BTC & Dominance Matrix. When Bitcoin rises while BTC dominance falls, capital rotation amplifies altcoin upside (2x); when Bitcoin drops while dominance rises, altcoins absorb amplified downside (2x).
TECHNICAL ARCHITECTURE

Multi-timeframe analysis inside one chart overlay.

Combines security-requested BTCUSDT and BTC.D series, customizable moving averages, and an on-chart summary table.

01

8-Timeframe Security Evaluation

get_trend2x queries BTCUSDT and CRYPTOCAP:BTC.D via request.security across 1M, 1W, 1D, 240 (4H), 60 (1H), 15, 5, and 1 minute periods alongside the active chart timeframe.

02

Dual Trend Detection Modes

Mode 1 compares current vs. previous close for immediate directional momentum; Mode 2 evaluates EMA alignment between the primary EMA (20) and long-horizon EMA/SMA filters (up to 200) for Up, Down, or Lateral states.

03

4 EMAs + 1 SMA & Extended Lines

Plots configurable EMA 1–4 (defaults 20, 50, 100, 200) and MA 1 (default 200) with optional line.new + label.new four-bar forward projections and current-timeframe background tinting.

04

Configurable On-Chart Summary Table

Populates a 10x10 Pine table across all 8 intervals showing Period, BTC Trend, Dominance Trend, BTC Behavior, and Altcoins Behavior with customizable corner placement, borders, text sizes, and heatmap colors.

INDICATOR SPECIFICATION

Exchanges, Behavior States & Disclaimer

PINE SCRIPT v6 • MPL 2.0
SUPPORTED FEEDS
  • BYBIT:BTCUSDT (default exchange)
  • BINANCE:BTCUSDT
  • COINBASE:BTCUSDT
  • KRAKEN:BTCUSDT (XBTUSD)
  • CRYPTOCAP:BTC.D dominance index
BEHAVIOR STATES
  • BTC Up + BTC.D Up -> BTC 2x / Alts 1x
  • BTC Up + BTC.D Down -> BTC 1x / Alts 2x
  • BTC Down + BTC.D Up -> BTC 1x / Alts 2x
  • BTC Down + BTC.D Down -> BTC 2x / Alts 1x
  • Lateral EMA zone -> Neutral indicator cell
DISTRIBUTION & NOTES
  • Published on TradingView (script/jgwMdlN7)
  • Source hosted in single-file script.pine
  • Mozilla Public License 2.0 (MPL 2.0)
  • Customizable table position & palette
  • Educational tool only — not financial advice
OPEN SOURCE INDICATOR

Open Pine Script v6 under MPL 2.0.

Published under the Mozilla Public License 2.0 on GitHub and TradingView. Provided strictly for educational chart analysis and not financial advice.

EXPLORE PACKAGESignal Dashboard: Traffic Light PanelEXPLORE PRODUCTStokivEXPLORE PRODUCTCatalisadorEXPLORE PRODUCTW30
LET’S BUILD WHAT’S NEXTIDEA → PRODUCTION

Have something
worth building?

Tell us what you’re working on.

Start a conversation

New product · Existing platform · Engineering partnership · Technical challenge