Correlation Heatmap Matrix [TradingFinder] 20 Assets Variable🔵 Introduction
Correlation is one of the most important statistical and analytical metrics in financial markets, data mining, and data science. It measures the strength and direction of the relationship between two variables.
The correlation coefficient always ranges between +1 and -1 : a perfect positive correlation (+1) means that two assets or currency pairs move together in the same direction and at a constant ratio, a correlation of zero (0) indicates no clear linear relationship, and a perfect negative correlation (-1) means they move in exactly opposite directions.
While the Pearson Correlation Coefficient is the most common method for calculation, other statistical methods like Spearman and Kendall are also used depending on the context.
In financial market analysis, correlation is a key tool for Forex, the Stock Market, and the Cryptocurrency Market because it allows traders to assess the price relationship between currency pairs, stocks, or coins. For example, in Forex, EUR/USD and GBP/USD often have a high positive correlation; in stocks, companies from the same sector such as Apple and Microsoft tend to move similarly; and in crypto, most altcoins show a strong positive correlation with Bitcoin.
Using a Correlation Heatmap in these markets visually displays the strength and direction of these relationships, helping traders make more accurate decisions for risk management and strategy optimization.
🟣 Correlation in Financial Markets
In finance, correlation refers to measuring how closely two assets move together over time. These assets can be stocks, currency pairs, commodities, indices, or cryptocurrencies. The main goal of correlation analysis in trading is to understand these movement patterns and use them for risk management, trend forecasting, and developing trading strategies.
🟣 Correlation Heatmap
A correlation heatmap is a visual tool that presents the correlation between multiple assets in a color-coded table. Each cell shows the correlation coefficient between two assets, with colors indicating its strength and direction. Warm colors (such as red or orange) represent strong negative correlation, cool colors (such as blue or cyan) represent strong positive correlation, and mid-range tones (such as yellow or green) indicate correlations that are close to neutral.
🟣 Practical Applications in Markets
Forex : Identify currency pairs that move together or in opposite directions, avoid overexposure to similar trades, and spot unusual divergences.
Crypto : Examine the dependency of altcoins on Bitcoin and find independent movers for portfolio diversification.
Stocks : Detect relationships between stocks in the same industry or find outliers that move differently from their sector.
🟣 Key Uses of Correlation in Trading
Risk management and diversification: Select assets with low or negative correlation to reduce portfolio volatility.
Avoiding overexposure: Prevent opening multiple positions on highly correlated assets.
Pairs trading: Exploit temporary deviations between historically correlated assets for arbitrage opportunities.
Intermarket analysis: Study the relationships between different markets like stocks, currencies, commodities, and bonds.
Divergence detection: Spot when two typically correlated assets move apart as a possible trend change signal.
Market forecasting: Use correlated asset movements to anticipate others’ behavior.
Event reaction analysis: Evaluate how groups of assets respond to economic or political events.
❗ Important Note
It’s important to note that correlation does not imply causation — it only reflects co-movement between assets. Correlation is also dynamic and can change over time, which is why analyzing it across multiple timeframes provides a more accurate picture. Combining correlation heatmaps with other analytical tools can significantly improve the precision of trading decisions.
🔵 How to Use
The Correlation Heatmap Matrix indicator is designed to analyze and manage the relationships between multiple assets at once. After adding the tool to your chart, start by selecting the assets you want to compare (up to 20).
Then, choose the Correlation Period that fits your trading strategy. Shorter periods (e.g., 20 bars) are more sensitive to recent price movements, making them suitable for short-term trading, while longer periods (e.g., 100 or 200 bars) provide a broader view of correlation trends over time.
The indicator outputs a color-coded matrix where each cell represents the correlation between two assets. Warm colors like red and orange signal strong negative correlation, while cool colors like blue and cyan indicate strong positive correlation. Mid-range tones such as yellow or green suggest correlations that are close to neutral. This visual representation makes it easy to spot market patterns at a glance.
One of the most valuable uses of this tool is in portfolio risk management. Portfolios with highly correlated assets are more vulnerable to market swings. By using the heatmap, traders can find assets with low or negative correlation to reduce overall risk.
Another key benefit is preventing overexposure. For example, if EUR/USD and GBP/USD have a high positive correlation, opening trades on both is almost like doubling the position size on one asset, increasing risk unnecessarily. The heatmap makes such relationships clear, helping you avoid them.
The indicator is also useful for pairs trading, where a trader identifies assets that are usually correlated but have temporarily diverged — a potential arbitrage or mean-reversion opportunity.
Additionally, the tool supports intermarket analysis, allowing traders to see how movements in one market (e.g., crude oil) may impact others (e.g., the Canadian dollar). Divergence detection is another advantage: if two typically aligned assets suddenly move in opposite directions, it could signal a major trend shift or a news-driven move.
Overall, the Correlation Heatmap Matrix is not just an analytical indicator but also a fast, visual alert system for monitoring multiple markets at once. This is particularly valuable for traders in fast-moving environments like Forex and crypto.
🔵 Settings
🟣 Logic
Correlation Period : Number of bars used to calculate correlation between assets.
🟣 Display
Table on Chart : Enable/disable displaying the heatmap directly on the chart.
Table Size : Choose the table size (from very small to very large).
Table Position : Set the table location on the chart (top, middle, or bottom in various alignments).
🟣 Symbol Custom
Select Market : Choose the market type (Forex, Stocks, Crypto, or Custom).
Symbol 1 to Symbol 20: In custom mode, you can define up to 20 assets for correlation calculation.
🔵 Conclusion
The Correlation Heatmap Matrix is a powerful tool for analyzing correlations across multiple assets in Forex, crypto, and stock markets. By displaying a color-coded table, it visually conveys both the strength and direction of correlations — warm colors for strong negative correlation, cool colors for strong positive correlation, and mid-range tones such as yellow or green for near-zero or neutral correlation.
This helps traders select assets with low or negative correlation for diversification, avoid overexposure to similar trades, identify arbitrage and pairs trading opportunities, and detect unusual divergences between typically aligned assets. With support for custom mode and up to 20 symbols, it offers high flexibility for different trading strategies, making it a valuable complement to technical analysis and risk management.
Assetmanagement
Correlation HeatMap Matrix Data [TradingFinder]🔵 Introduction
Correlation is a statistical measure that shows the degree and direction of a linear relationship between two assets.
Its value ranges from -1 to +1 : +1 means perfect positive correlation, 0 means no linear relationship, and -1 means perfect negative correlation.
In financial markets, correlation is used for portfolio diversification, risk management, pairs trading, intermarket analysis, and identifying divergences.
Correlation HeatMap Matrix Data TradingFinder is a Pine Script v6 library that calculates and returns raw correlation matrix data between up to 20 symbols. It only provides the data – it does not draw or render the heatmap – making it ideal for use in other scripts that handle visualization or further analysis. The library uses ta.correlation for fast and accurate calculations.
It also includes two helper functions for visual styling :
CorrelationColor(corr) : takes the correlation value as input and generates a smooth gradient color, ranging from strong negative to strong positive correlation.
CorrelationTextColor(corr) : takes the correlation value as input and returns a text color that ensures optimal contrast over the background color.
Library
"Correlation_HeatMap_Matrix_Data_TradingFinder"
CorrelationColor(corr)
Parameters:
corr (float)
CorrelationTextColor(corr)
Parameters:
corr (float)
Data_Matrix(Corr_Period, Sym_1, Sym_2, Sym_3, Sym_4, Sym_5, Sym_6, Sym_7, Sym_8, Sym_9, Sym_10, Sym_11, Sym_12, Sym_13, Sym_14, Sym_15, Sym_16, Sym_17, Sym_18, Sym_19, Sym_20)
Parameters:
Corr_Period (int)
Sym_1 (string)
Sym_2 (string)
Sym_3 (string)
Sym_4 (string)
Sym_5 (string)
Sym_6 (string)
Sym_7 (string)
Sym_8 (string)
Sym_9 (string)
Sym_10 (string)
Sym_11 (string)
Sym_12 (string)
Sym_13 (string)
Sym_14 (string)
Sym_15 (string)
Sym_16 (string)
Sym_17 (string)
Sym_18 (string)
Sym_19 (string)
Sym_20 (string)
🔵 How to use
Import the library into your Pine Script using the import keyword and its full namespace.
Decide how many symbols you want to include in your correlation matrix (up to 20). Each symbol must be provided as a string, for example FX:EURUSD .
Choose the correlation period (Corr\_Period) in bars. This is the lookback window used for the calculation, such as 20, 50, or 100 bars.
Call Data_Matrix(Corr_Period, Sym_1, ..., Sym_20) with your selected parameters. The function will return an array containing the correlation values for every symbol pair (upper triangle of the matrix plus diagonal).
For example :
var string Sym_1 = '' , var string Sym_2 = '' , var string Sym_3 = '' , var string Sym_4 = '' , var string Sym_5 = '' , var string Sym_6 = '' , var string Sym_7 = '' , var string Sym_8 = '' , var string Sym_9 = '' , var string Sym_10 = ''
var string Sym_11 = '', var string Sym_12 = '', var string Sym_13 = '', var string Sym_14 = '', var string Sym_15 = '', var string Sym_16 = '', var string Sym_17 = '', var string Sym_18 = '', var string Sym_19 = '', var string Sym_20 = ''
switch Market
'Forex' => Sym_1 := 'EURUSD' , Sym_2 := 'GBPUSD' , Sym_3 := 'USDJPY' , Sym_4 := 'USDCHF' , Sym_5 := 'USDCAD' , Sym_6 := 'AUDUSD' , Sym_7 := 'NZDUSD' , Sym_8 := 'EURJPY' , Sym_9 := 'EURGBP' , Sym_10 := 'GBPJPY'
,Sym_11 := 'AUDJPY', Sym_12 := 'EURCHF', Sym_13 := 'EURCAD', Sym_14 := 'GBPCAD', Sym_15 := 'CADJPY', Sym_16 := 'CHFJPY', Sym_17 := 'NZDJPY', Sym_18 := 'AUDNZD', Sym_19 := 'USDSEK' , Sym_20 := 'USDNOK'
'Stock' => Sym_1 := 'NVDA' , Sym_2 := 'AAPL' , Sym_3 := 'GOOGL' , Sym_4 := 'GOOG' , Sym_5 := 'META' , Sym_6 := 'MSFT' , Sym_7 := 'AMZN' , Sym_8 := 'AVGO' , Sym_9 := 'TSLA' , Sym_10 := 'BRK.B'
,Sym_11 := 'UNH' , Sym_12 := 'V' , Sym_13 := 'JPM' , Sym_14 := 'WMT' , Sym_15 := 'LLY' , Sym_16 := 'ORCL', Sym_17 := 'HD' , Sym_18 := 'JNJ' , Sym_19 := 'MA' , Sym_20 := 'COST'
'Crypto' => Sym_1 := 'BTCUSD' , Sym_2 := 'ETHUSD' , Sym_3 := 'BNBUSD' , Sym_4 := 'XRPUSD' , Sym_5 := 'SOLUSD' , Sym_6 := 'ADAUSD' , Sym_7 := 'DOGEUSD' , Sym_8 := 'AVAXUSD' , Sym_9 := 'DOTUSD' , Sym_10 := 'TRXUSD'
,Sym_11 := 'LTCUSD' , Sym_12 := 'LINKUSD', Sym_13 := 'UNIUSD', Sym_14 := 'ATOMUSD', Sym_15 := 'ICPUSD', Sym_16 := 'ARBUSD', Sym_17 := 'APTUSD', Sym_18 := 'FILUSD', Sym_19 := 'OPUSD' , Sym_20 := 'USDT.D'
'Custom' => Sym_1 := Sym_1_C , Sym_2 := Sym_2_C , Sym_3 := Sym_3_C , Sym_4 := Sym_4_C , Sym_5 := Sym_5_C , Sym_6 := Sym_6_C , Sym_7 := Sym_7_C , Sym_8 := Sym_8_C , Sym_9 := Sym_9_C , Sym_10 := Sym_10_C
,Sym_11 := Sym_11_C, Sym_12 := Sym_12_C, Sym_13 := Sym_13_C, Sym_14 := Sym_14_C, Sym_15 := Sym_15_C, Sym_16 := Sym_16_C, Sym_17 := Sym_17_C, Sym_18 := Sym_18_C, Sym_19 := Sym_19_C , Sym_20 := Sym_20_C
= Corr.Data_Matrix(Corr_period, Sym_1 ,Sym_2 ,Sym_3 ,Sym_4 ,Sym_5 ,Sym_6 ,Sym_7 ,Sym_8 ,Sym_9 ,Sym_10,Sym_11,Sym_12,Sym_13,Sym_14,Sym_15,Sym_16,Sym_17,Sym_18,Sym_19,Sym_20)
Loop through or index into this array to retrieve each correlation value for your custom layout or logic.
Pass each correlation value to CorrelationColor() to get the corresponding gradient background color, which reflects the correlation’s strength and direction (negative to positive).
For example :
Corr.CorrelationColor(SYM_3_10)
Pass the same correlation value to CorrelationTextColor() to get the correct text color for readability against that background.
For example :
Corr.CorrelationTextColor(SYM_1_1)
Use these colors in a table or label to render your own heatmap or any other visualization you need.
Multi TF Oscillators Screener [TradingFinder] RSI / ATR / Stoch🔵 Introduction
The oscillator screener is designed to simplify multi-timeframe analysis by allowing traders and analysts to monitor one or multiple symbols across their preferred timeframes—all at the same time. Users can track a single symbol through various timeframes simultaneously or follow multiple symbols in selected intervals. This flexibility makes the tool highly effective for analyzing diverse markets concurrently.
At the core of this screener lie two essential oscillators: RSI (Relative Strength Index) and the Stochastic Oscillator. The RSI measures the speed and magnitude of recent price movements and helps identify overbought or oversold conditions.
It's one of the most reliable indicators for spotting potential reversals. The Stochastic Oscillator, on the other hand, compares the current price to recent highs and lows to detect momentum strength and potential trend shifts. It’s especially effective in identifying divergences and short-term reversal signals.
In addition to these two primary indicators, the screener also displays helpful supplementary data such as the dominant candlestick type (Bullish, Bearish, or Doji), market volatility indicators like ATR and TR, and the four key OHLC prices (Open, High, Low, Close) for each symbol and timeframe. This combination of data gives users a comprehensive technical view and allows for quick, side-by-side comparison of symbols and timeframes.
🔵 How to Use
This tool is built for users who want to view the behavior of a single symbol across several timeframes simultaneously. Instead of jumping between charts, users can quickly grasp the state of a symbol like gold or Bitcoin across the 15-minute, 1-hour, and daily timeframes at a glance. This is particularly useful for traders who rely on multi-timeframe confirmation to strengthen their analysis and decision-making.
The tool also supports simultaneous monitoring of multiple symbols. Users can select and track various assets based on the timeframes that matter most to them. For example, if you’re looking for entry opportunities, the screener allows you to compare setups across several markets side by side—making it easier to choose the most favorable trade. Whether you’re a scalper focused on low timeframes or a swing trader using higher ones, the tool adapts to your workflow.
The screener utilizes the widely-used RSI indicator, which ranges from 0 to 100 and highlights market exhaustion levels. Readings above 70 typically indicate potential pullbacks, while values below 30 may suggest bullish reversals. Viewing RSI across timeframes can reveal meaningful divergences or alignments that improve signal quality.
Another key indicator in the screener is the Stochastic Oscillator, which analyzes the closing price relative to its recent high-low range. When the %K and %D lines converge and cross within the overbought or oversold zones, it often signals a momentum reversal. This oscillator is especially responsive in lower timeframes, making it ideal for spotting quick entries or exits.
Beyond these oscillators, the table includes other valuable data such as candlestick type (bullish, bearish, or doji), volatility measures like ATR and TR, and complete OHLC pricing. This layered approach helps users understand both market momentum and structure at a glance.
Ultimately, this screener allows analysts and traders to gain a full market overview with just one look—empowering faster, more informed, and lower-risk decision-making. It not only saves time but also enhances the precision and clarity of technical analysis.
🔵 Settings
🟣 Display Settings
Table Size : Lets you adjust the table’s visual size with options such as: auto, tiny, small, normal, large, huge.
Table Position : Sets the screen location of the table. Choose from 9 possible positions, combining vertical (top, middle, bottom) and horizontal (left, center, right) alignments.
🟣 Symbol Settings
Each of the 10 symbol slots comes with a full set of customizable parameters :
Enable Symbol : A checkbox to activate or hide each symbol from the table.
Symbol : Define or select the asset (e.g., XAUUSD, BTCUSD, EURUSD, etc.).
Timeframe : Set your desired timeframe for each symbol (e.g., 15, 60, 240, 1D).
RSI Length : Defines the period used in RSI calculation (default is 14).
Stochastic Length : Sets the period for the Stochastic Oscillator.
ATR Length : Sets the length used to calculate the Average True Range, a key volatility metric.
🔵 Conclusion
By combining powerful oscillators like RSI and Stochastic with full customization over symbols and timeframes, this tool provides a fast, flexible solution for technical analysts. Users can instantly monitor one or several assets across multiple timeframes without opening separate charts.
Individual configuration for each symbol, along with the inclusion of key metrics like candlestick type, ATR/TR, and OHLC prices, makes the tool suitable for a wide range of trading styles—from scalping to swing and position trading.
In summary, this screener enables traders to gain a clear, high-level view of various markets in seconds and make quicker, smarter, and lower-risk decisions. It saves time, streamlines analysis, and boosts overall efficiency and confidence in trading strategies.
Gabriel's Asset Rotation System📈 Gabriel's Asset Rotation System
Overview
Gabriel’s Asset Rotation System is an advanced multi-asset trend-following tool that dynamically ranks and rotates up to 6 assets (plus USD) based on a customizable trend scoring matrix. Using enhanced signal detection techniques like Cauchy-weighted Supertrend, Jurík RSX, Fisherized CCI, Kalman-filtered PSAR, and Dynamic DMI Smoothing, the system identifies the most dominant asset and simulates strategy equity performance compared to buy-and-hold benchmarks.
🔍 Key Features
✅ Multi-Asset Rotation: Analyze up to 6 symbols and USD simultaneously.
✅ Relative Strength Matrix: Compares every asset against each other to find outperformers.
✅ Custom Trend Engine:
Jurik RSX with advanced RSX logic
Fisherized CCI for momentum confirmation
Kalman-smoothed PSAR for trend bias
SuperTrend using a Cauchy Moving Average
Smoothed DMI signal across looped periods (10–17)
✅ Dynamic Best Asset Detection: Identifies and tracks the asset with the highest trend score over time.
✅ Performance Table: Displays Sharpe, Sortino, and Omega Ratios along with drawdowns and means for both strategy and each asset.
✅ Visual Trend Matrix: Tabular view of asset strength comparisons against each other + final scoring.
✅ Realistic Strategy Equity Curve: Tracks performance assuming full capital rotation into the best asset.
✅ Alerts: Get notified when the top-performing asset changes.
⚙️ Inputs
🔹 Assets: Customize 6 tickers (crypto, stocks, ETFs, etc.)
🔹 Trend Classification Method:
RSI
CCI
SuperTrend
DMI
PSAR
or use all together
🔹 Jurik RSX Length
🔹 Fisherized CCI Length
🔹 Cauchy MA Gamma and ATR Settings
🔹 DMI Range and MA Type (SMA, EMA, HMA, etc.)
🔹 PSAR Parameters with Kalman smoothing
🔹 Custom Backtest Start Date
📊 Outputs
Plot 1: Best Asset Equity (colored dynamically)
Plot 2–7: Buy & Hold Curves for each asset (with labels)
Tables:
Rotation Matrix (bottom-right)
Best Performing Asset (bottom-center)
Performance Metrics Table (optional toggle)
🧠 Use Case Ideas
🔁 Dynamic Portfolio Rebalancing
⚖️ Compare Risk-Adjusted Returns Across Crypto or Stocks
🧪 Backtest Rotation Hypotheses
🚀 Identify Strongest Breakout Assets in Trend Environments
📉 Avoid Weakening Assets with Rising Drawdowns
🚨 Alerts
🔔 "New Optimal Asset": Triggers when a new top-ranking asset replaces the current one.
Asset Allocation CalculatorOverview
This script is a tool that automatically calculates asset allocation for your investment portfolio. Users can set the weight of multiple assets and monitor the portfolio value in real time based on price fluctuations.
Key Features
Supports input of asset allocation percentages
Dynamic allocation calculation based on real-time price data
Automatically calculates allocated amounts for each asset based on the total investment amount
User-friendly interface with intuitive visual feedback
Settings
Total Capital : Enter the total capital, including the value of assets.
Quantity rounding : Using the rounding function may cause the target allocation to exceed 100%.
Tickers, Weight, Holdings :
To retrieve accurate asset prices, specify both the exchange and the ticker.
If you want to include cash in your portfolio, use $.
Ensure that the total allocation sums to 100%.
Refer to the pre-filled example for the correct format.
Table Settings : You can adjust the table's position, height, font size, and background color.
How to Use
By buying or selling the quantity shown in the Buy column, you can continuously maintain your target allocation.
Hold - Current holdings
Buy - Quantity to buy or sell to reach the target allocation
Target - Quantity aimed for after buying or selling
Caution
It can only calculate for a single currency, so do not mix multiple currency markets.
자산 배분 계산기
소개
이 스크립트는 투자 포트폴리오의 자산 배분을 자동으로 계산해주는 도구입니다. 사용자는 여러 자산의 비중을 설정할 수 있으며, 가격 변동에 따라 포트폴리오 가치를 실시간으로 모니터링할 수 있습니다.
주요 기능
자산 배분 비율 입력 지원
실시간 가격 데이터를 기반으로 한 동적 배분 계산
총 투자 금액을 기준으로 각 자산에 할당된 금액 자동 계산
직관적인 시각적 피드백을 제공하는 사용자 친화적인 인터페이스
설정
Total Capital : 자산 가치를 포함한 총 자본금을 입력하세요.
Quantity rounding : 반올림 기능을 사용하면 목표 비중이 100%를 초과할 수 있습니다.
Tickers, Weight, Holdings :
정확한 자산 가격을 불러오기 위해 거래소와 티커를 함께 입력하세요.
포트폴리오에 현금을 포함하려면 '$'를 사용하세요.
비중 합계가 반드시 100%가 되도록 설정하세요.
예제 형식을 참고하여 올바르게 입력하세요.
한국(원화) 시장을 위한 입력 예시입니다.
KRX:360750, 17.5, 100
KRX:310960, 17.5, 120
KRX:148070, 25, 20
KRX:305080, 25, 10
KRX:139320, 10, 150
UPBIT:BTCKRW, 5, 0.002
$,0,5000000
Table Settings : 테이블의 위치, 높이, 글자 크기 및 배경색을 조정할 수 있습니다.
사용 방법
Buy 열에 표시된 수량만큼 매수 또는 매도하면 목표 비중을 지속적으로 유지할 수 있습니다.
Hold - 현재 보유 수량
Buy - 목표 비중을 맞추기 위해 매수 또는 매도해야 하는 수량
Target - 매수, 매도 후 목표로 하는 수량
주의
한 가지 통화로만 계산할 수 있으니 여러 통화 시장을 혼용하지 마세요.
Lead-Lag Market Detector [CryptoSea]The Lead-Lag Market Detector is an advanced tool designed to help traders identify leading and lagging assets within a chosen market. This indicator leverages correlation analysis to rank assets based on their influence, making it ideal for traders seeking to optimise their portfolio or spot key market trends.
Key Features
Dynamic Asset Ranking: Utilises real-time correlation calculations to rank assets by their influence on the market, helping traders identify market leaders and laggers.
Customisable Parameters: Includes adjustable lookback periods and correlation thresholds to adapt the analysis to different market conditions and trading styles.
Comprehensive Asset Coverage: Supports up to 30 assets, offering broad market insights across cryptocurrencies, stocks, or other markets.
Gradient-Enhanced Table Display: Presents results in a colour-coded table, where assets are ranked dynamically with influence scores, aiding in quick visual analysis.
In the example below, the ranking highlights how assets tend to move in groups. For instance, BTCUSDT, ETHUSDT, BNBUSDT, SOLUSDT, and LTCUSDT are highly correlated and moving together as a group. Similarly, another group of correlated assets includes XRPUSDT, FILUSDT, APEUSDT, XTZUSDT, THETAUSDT, and CAKEUSDT. This grouping of assets provides valuable insights for traders to diversify or spread exposure.
If you believe one asset in a group is likely to perform well, you can spread your exposure into other correlated assets within the same group to capitalise on their collective movement. Additionally, assets like AVAXUSDT and ZECUSDT, which appear less correlated or uncorrelated with the rest, may offer opportunities to act as potential hedges in your trading strategy.
How it Works
Correlation-Based Scoring: Calculates pairwise correlations between assets over a user-defined lookback period, identifying assets with high influence scores as market leaders.
Customisable Thresholds: Allows traders to define a correlation threshold, ensuring the analysis focuses only on significant relationships between assets.
Dynamic Score Calculation: Scores are updated dynamically based on the timeframe and input settings, providing real-time insights into market behaviour.
Colour-Enhanced Results: The table display uses gradients to visually distinguish between leading and lagging assets, simplifying data interpretation.
Application
Portfolio Optimisation: Identifies influential assets to help traders allocate their portfolio effectively and reduce exposure to lagging assets.
Market Trend Identification: Highlights leading assets that may signal broader market trends, aiding in strategic decision-making.
Customised Trading Strategies: Adapts to various trading styles through extensive input settings, ensuring the analysis meets the specific needs of each trader.
The Lead-Lag Market Detector by is an essential tool for traders aiming to uncover market leaders and laggers, navigate complex market dynamics, and optimise their trading strategies with precision and insight.
Cobra's CryptoMarket VisualizerCobra's Crypto Market Screener is designed to provide a comprehensive overview of the top 40 marketcap cryptocurrencies in a table\heatmap format. This indicator incorporates essential metrics such as Beta, Alpha, Sharpe Ratio, Sortino Ratio, Omega Ratio, Z-Score, and Average Daily Range (ADR). The table utilizes cell coloring resembling a heatmap, allowing for quick visual analysis and comparison of multiple cryptocurrencies.
The indicator also includes a shortened explanation tooltip of each metric when hovering over it's respected cell. I shall elaborate on each here for anyone interested.
Metric Descriptions:
1. Beta: measures the sensitivity of an asset's returns to the overall market returns. It indicates how much the asset's price is likely to move in relation to a benchmark index. A beta of 1 suggests the asset moves in line with the market, while a beta greater than 1 implies the asset is more volatile, and a beta less than 1 suggests lower volatility.
2. Alpha: is a measure of the excess return generated by an investment compared to its expected return, given its risk (as indicated by its beta). It assesses the performance of an investment after adjusting for market risk. Positive alpha indicates outperformance, while negative alpha suggests underperformance.
3. Sharpe Ratio: measures the risk-adjusted return of an investment or portfolio. It evaluates the excess return earned per unit of risk taken. A higher Sharpe ratio indicates better risk-adjusted performance, as it reflects a higher return for each unit of volatility or risk.
4. Sortino Ratio: is a risk-adjusted measure similar to the Sharpe ratio but focuses only on downside risk. It considers the excess return per unit of downside volatility. The Sortino ratio emphasizes the risk associated with below-target returns and is particularly useful for assessing investments with asymmetric risk profiles.
5. Omega Ratio: measures the ratio of the cumulative average positive returns to the cumulative average negative returns. It assesses the reward-to-risk ratio by considering both upside and downside performance. A higher Omega ratio indicates a higher reward relative to the risk taken.
6. Z-Score: is a statistical measure that represents the number of standard deviations a data point is from the mean of a dataset. In finance, the Z-score is commonly used to assess the financial health or risk of a company. It quantifies the distance of a company's financial ratios from the average and provides insight into its relative position.
7. Average Daily Range: ADR represents the average range of price movement of an asset during a trading day. It measures the average difference between the high and low prices over a specific period. Traders use ADR to gauge the potential price range within which an asset might fluctuate during a typical trading session.
Utility:
Comprehensive Overview: The indicator allows for monitoring up to 40 cryptocurrencies simultaneously, providing a consolidated view of essential metrics in a single table.
Efficient Comparison: The heatmap-like coloring of the cells enables easy visual comparison of different cryptocurrencies, helping identify relative strengths and weaknesses.
Risk Assessment: Metrics such as Beta, Alpha, Sharpe Ratio, Sortino Ratio, and Omega Ratio offer insights into the risk associated with each cryptocurrency, aiding risk assessment and portfolio management decisions.
Performance Evaluation: The Alpha, Sharpe Ratio, and Sortino Ratio provide measures of a cryptocurrency's performance adjusted for risk. This helps assess investment performance over time and across different assets.
Market Analysis: By considering the Z-Score and Average Daily Range (ADR), traders can evaluate the financial health and potential price volatility of cryptocurrencies, aiding in trade selection and risk management.
Features:
Reference period optimization, alpha and ADR in particular
Source calculation
Table sizing and positioning options to fit the user's screen size.
Tooltips
Important Notes -
1. The Sharpe, Sortino and Omega ratios cell coloring threshold might be subjective, I did the best I can to gauge the median value of each to provide more accurate coloring sentiment, it may change in the future.
The median values are : Sharpe -1, Sortino - 1.5, Omega - 20.
2. Limitations - Some cryptos have a Z-Score value of NaN due to their short lifetime, I tried to overcome this issue as with the rest of the metrics as best I can. Moreover, it limits the time horizon for replay mode to somewhere around Q3 of 2021 and that's with using the split option of the top half, to remain with the older cryptos.
3. For the beginner Pine enthusiasts, I recommend scimming through the script as it serves as a prime example of using key features, to name a few : Arrays, User Defined Functions, User Defined Types, For loops, Switches and Tables.
4. Beta and Alpha's benchmark instrument is BTC, due to cryptos volatility I saw no reason to use SPY or any other asset for that matter.
Portfolio Tracker For Stocks & CryptoThis is a portfolio tracker that will track individual, overall and daily profit/loss for up to 12 assets. You can set the size of your buys and price of your buys for accurate, up to date profit and loss data right on your chart. It works on all markets and timeframes.
HOW TO USE
Go into the indicator settings and you will see all of the available settings. The first is the ability to turn the tracker info table on or off from the chart, so it saves your portfolio info but let’s you remove it from the chart while trading. Second is the option to move the position of the info table to suit your preference.
Next we get into setting up your portfolio tickers, order size and price. Each ticker lets you set which stock/crypto you bought, then set how much you purchased and then what price you purchased them at.
Go through and set up all of your assets and then turn off any tickers that you don’t need. Once that is all done, your portfolio will be shown on the chart with all the data.
FEATURES
Top Section
The portfolio tracker has 2 sections. The top section shows each ticker in your portfolio individually with the following data:
- Ticker Name
- Weight of that asset compared to your total portfolio in %
- Current value of that position in $
- Profit or loss value from purchase price in %
- Todays change in value from yesterday’s close in %
The $ Value, PnL % and Today % will all change colors from green to red depending if they are in profit or not.
Bottom Section
The bottom section of the tracker will give you info for your portfolio as a whole. It has the following data:
- Total cost of your entire portfolio in $
- Current value of your entire portfolio in $
- Current profit or loss of your entire portfolio in $
- Current profit or loss of your entire portfolio in %
- Todays change of your entire portfolio value compared to yesterday’s close in %
The $ Value, PnL $, PnL % and Today % will all change colors from green to red depending if they are in profit or not.
Portfolio Tracker [Anan]█ OVERVIEW
A simple Portfolio Tracker to track your Profit/Loss for any ticker in any market (stock, futures, index, forex, crypto, fund, dr.).
You just need to input (Asset / Quantity / Avg. Buy/Sell Price) and the script will calculate everything.
Also, you can use it for paper trading, or even what-if cases..
█ FEATURES
- Up to 10 positions
- Track your position real-time price and 24H change %
- Calculate your position current value
- Calculate your position cost value
- Calculate Profit/Loss
- Calculate Profit/Loss %
- Change every color in the table as you like.
Combo Month-to-Month % ReturnA combined version of two already published indicators:
Combo Month-to-Month % Return (January - June)
Combo Month-to-Month % Return (July - December)
Allows to compare an asset's monthly returns over years.
Includes:
Customizable columns
Up to 20 columns per each chart
Customizable Min, Max, Mean, Median and Standard Deviation lines
Customizable labels
Portfolio Backtester [MS]Portfolio Backtester (with rebalancing) for any assets you choose.
Simple to use, input any assets and their percentage allocations, choose a rebalance interval, then see how that portfolio performs over time.
To compare two or more portfolios, add this indicator multiple times, click and drag one on top of the other (into the same pane), then pin both to the same scale .
Its recommended to view this "indicator" on an asset with lots of historical data in order to have the most flexibility in a Start Date. Calculations are limited by chart you're viewing.
Settings
• Input the portfolio's assets
• Input the assets' allocations
• Input start and end dates
• Set the initial capital investment
• Set the rebalancing period (visualized as dots on the chart)
• Display Performance label
• Display Rebalancing labels
Things To Note
• The Start Date will be the later of the date you enter and the first candle of the chart you're viewing.
• If an asset's data doesn't exist at the start or any rebalance, it's percentage allocation will go to cash.
• The backtester calculates purely on asset price, and does not take into account any commissions, fees, dividends, or any other extra additions or deductions.
Version 1: only supports whole-shares, and not fractional-shares of assets.
PM us with any questions about this indicator.
Combo Month-to-Month % Return (July - December)This tool acts as Month-to-Month % Return but in Combo mode. Allows to compare the asset's monthly performances across the preferred years. It works everywhere but better in use on the daily timeframe.
Combo Month-to-Month % Return (January - June)This tool acts as Month-to-Month % Return but in Combo mode. Allows to compare the asset's monthly performances across the preferred years. It works everywhere but better in use on the daily timeframe.