Bitcoin Impact Analyzer

Script Summary:
The "Bitcoin Impact Analyzer" script is designed to help traders and analysts understand the relationship between a chosen altcoin and Bitcoin (BTC). It does this by:
Fetching price data for the specified altcoin and Bitcoin.
Calculating several key comparative metrics:
Normalized Prices: Shows the percentage performance of both assets from a common starting point.
Price Correlation: Measures how similarly the two assets' prices move over a defined period.
Beta: Indicates the altcoin's volatility relative to Bitcoin.
Altcoin/BTC Ratio: Shows the altcoin's value expressed in Bitcoin.
Fetching and displaying Bitcoin Dominance (BTC.D) data.
Visualizing these metrics on the chart as distinct plots.
Displaying the current values of these key metrics in a data table on the chart for quick reference.
The script aims to provide insights into whether an altcoin is outperforming or underperforming Bitcoin, how closely its price movements are tied to Bitcoin's, and its relative volatility.
User Adjustments:
Users can customize the script's behavior through several input settings:
Symbol Inputs:
Altcoin Symbol: Users can enter the ticker symbol for any altcoin they wish to analyze (e.g., BINANCE:ETHUSDT, KUCOIN:SOLUSDT).
Bitcoin Reference Symbol: Users can specify the Bitcoin pair to use as a reference, though BINANCE:BTCUSDT is a common default.
Lookback for Correlation/Beta:
Lookback Period: This integer value (default 50 periods) determines how many past candles are used to calculate the price correlation and beta.
A shorter lookback makes the metrics more sensitive to recent price action.
A longer lookback provides a smoother, more stable indication of the longer-term relationship.
Plot Visibility Options:
Users can toggle on or off the display of each individual plot on the chart:
Normalized BTC & Altcoin Prices
Altcoin/BTC Ratio
Correlation Plot
Bitcoin Dominance (BTC.D)
Beta Plot
This allows users to focus on specific metrics and reduce chart clutter.
What the Chart Represents:
The chart visually displays the historical trends and relationships of the selected metrics:
Normalized Prices Plot: Two lines (typically orange for BTC, blue for the altcoin) show the percentage growth of each asset from the start of the loaded chart data (or the first available data point for each symbol). This makes it easy to see which asset has performed better over time on a relative basis.
Correlation Plot: A single line (purple) oscillates between -1 and +1.
Values near +1 indicate a strong positive correlation (altcoin and BTC prices tend to move in the same direction).
Values near -1 indicate a strong negative correlation (they tend to move in opposite directions).
Values near 0 indicate little to no linear relationship.
Lines at +0.7 and -0.7 are often plotted as thresholds for "strong" correlation.
Beta Plot (if enabled): A single line (teal) shows the altcoin's volatility relative to BTC.
A Beta of 1 (often marked by a dashed line) means the altcoin has, on average, the same volatility as BTC.
Beta > 1 suggests the altcoin is more volatile than BTC (moves by a larger percentage for a given BTC move).
Beta < 1 suggests the altcoin is less volatile than BTC.
Bitcoin Dominance Plot: An area plot (gray) shows the percentage of the total cryptocurrency market capitalization that Bitcoin holds. This helps understand broader market sentiment and capital flows.
Altcoin/BTC Ratio Plot: A line (fuchsia) shows the price of the altcoin denominated in BTC.
An upward trend means the altcoin is gaining value against Bitcoin (outperforming).
A downward trend means the altcoin is losing value against Bitcoin (underperforming).
What the Table Represents:
The data table, typically located in the bottom-right corner of the chart, provides a snapshot of the current values for the most important calculated metrics. It includes:
Altcoin: The ticker symbol of the analyzed altcoin.
Bitcoin Ref: The ticker symbol of the Bitcoin reference.
Correlation (lookback): The current correlation coefficient between the altcoin and BTC, based on the specified lookback period. The value is color-coded (e.g., green for strong positive, red for strong negative).
Beta (lookback): The current beta value of the altcoin relative to BTC, based on the specified lookback period. The value may be color-coded to highlight significantly high or low volatility.
BTC.D Current: The current Bitcoin Dominance percentage.
ALT/BTC Ratio: The current price of the altcoin expressed in Bitcoin.
The table offers a quick, at-a-glance summary of the present market dynamics between the two assets without needing to interpret the lines on the chart for their exact current values.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.