OPEN-SOURCE SCRIPT
Tech Leadership Map+ [Herman]

Tech Leadership Map [Herman]
Tech Leadership Map is a relative-market leadership indicator designed to show whether technology-focused market activity is currently leading, lagging, or moving without a clear advantage relative to the broader US equity market.
The indicator does not generate traditional buy or sell signals. Instead, it provides an additional market-context layer that can help traders evaluate whether current market participation supports or conflicts with the directional move they are analyzing.
It includes two selectable and independent leadership models:
* **Price**
* **Volume Pressure**
Both models convert several measurements into a standardized four-component composite score.
---
Why Tech Leadership Matters
Technology shares represent an important component of US equity index activity, particularly for Nasdaq-related instruments.
When technology is outperforming the broader market, Nasdaq-focused markets may be receiving stronger relative participation. When technology is underperforming, broader-market strength may not be confirmed by technology leadership.
This indicator attempts to make that relationship easier to observe directly on the chart.
It should be treated as a **relative-market context tool**, not as a standalone forecasting system.
---
Leadership States
The indicator evaluates four separate components.
Each component contributes:
**+1** = favors the selected technology leader
**0** = neutral / unavailable confirmation
**-1** = favors the benchmark
The resulting Composite Score can therefore range from:
**+4 to -4**
The default classification is:
**GREEN — Tech Leading**
Composite Score of +2 or higher.
Technology-oriented activity is showing stronger relative leadership than the selected benchmark.
**YELLOW — No Clear Edge**
Composite Score between -1 and +1.
The measurements are mixed and neither side has sufficient agreement to establish a clear leadership state.
**RED — Tech Lagging**
Composite Score of -2 or lower.
Technology-oriented activity is showing weaker relative leadership than the selected benchmark.
These colors describe the current relative-leadership condition. They do not represent predictions of future price direction.
---
# 1. PRICE MODE
The default Price model compares:
**QQQ — Price Leader**
with
**SPY — Price Benchmark**
Both symbols can be changed in the indicator settings.
The model evaluates four components.
### 1. Performance From RTH Open
The indicator measures the percentage performance of QQQ and SPY from the beginning of the configured US Regular Trading Hours session.
It then compares those performances.
If QQQ has performed better from the RTH open, the component favors the leader.
If SPY has performed better, it favors the benchmark.
---
### 2. Relative-Strength Ratio Slope
The indicator calculates the relative-strength relationship:
**QQQ / SPY**
The logarithm of this ratio is evaluated using a linear-regression slope.
A rising relative-strength relationship indicates improving technology leadership.
A falling relationship indicates weakening technology leadership relative to the benchmark.
---
### 3. Short-Term Momentum Difference
The model compares short-term rate-of-change momentum between the leader and benchmark.
By default, this component uses a 5-bar momentum comparison.
This allows the indicator to identify situations where both markets may be moving in the same direction while one is accelerating more strongly than the other.
---
### 4. Correlation-Break Confirmation
QQQ and SPY normally exhibit a relatively high degree of correlation.
The indicator measures correlation between their logarithmic returns.
When correlation falls below the model's internal threshold, the short-term momentum difference receives an additional confirmation vote.
The purpose of this component is to emphasize periods where relative movement becomes more meaningful because the two markets are no longer behaving as closely together.
---
# 2. VOLUME PRESSURE MODE
Volume Pressure provides an alternative model that does **not use QQQ/SPY price movement to determine leadership**.
The default market-internal sources are:
**NASDAQ: VOLDQ**
versus
**Broad Market / NYSE: VOLD**
These represent net up-volume minus down-volume market internals.
The symbols are editable because VOLDQ and VOLD represent different market universes and should not be interpreted as literal constituent-by-constituent equivalents of QQQ and SPY.
---
## Normalization
NASDAQ and broad-market internal series can operate on substantially different numerical scales.
For that reason, the indicator first normalizes each series independently before comparing them.
This prevents the raw numerical magnitude of one internal from automatically dominating the comparison.
---
## Volume Pressure Components
The model then evaluates four measurements.
### 1. Pressure Level
Compares the current normalized leader pressure with the normalized benchmark pressure.
---
### 2. Fast Pressure
Applies short-term smoothing to both normalized internal series and compares their relative position.
This helps reduce some bar-to-bar noise while preserving short-term changes in leadership.
---
### 3. Pressure Momentum
Measures the change in normalized internal pressure over the selected momentum lookback.
This identifies which market internal is currently improving or deteriorating faster.
---
### 4. Pressure Impulse
Each normalized internal is compared with its own slower baseline.
The difference between those impulses determines which market is showing the stronger deviation from its recent baseline.
---
# Chart Display
The default visualization uses colored dots placed along the chart.
The colors correspond directly to the current leadership state:
**Green = Tech Leading**
**Yellow = No Clear Edge**
**Red = Tech Lagging**
Optional chart-bar coloring can also be enabled.
By default, leadership dots are displayed only during the configured US Regular Trading Hours session:
**09:30–16:00 New York time**
This behavior can be changed in the settings.
---
# Statistics Table
The optional statistics table provides additional information about the active model.
Depending on the selected source, it displays:
* active leadership source
* current leadership state
* Composite Score
* individual component votes
* correlation in Price mode
* normalized internal gap in Volume Pressure mode
The table is intended to make the calculation transparent rather than displaying only the final color.
---
# How to Use It
The indicator is primarily intended as a **confirmation and market-context tool**.
For example, when analyzing a Nasdaq-related market, a trader may compare the current directional setup with the technology leadership state.
A bullish market setup occurring while technology is leading represents a different relative-market environment from the same setup occurring while technology is lagging.
Similarly, a bearish setup occurring while technology leadership is weakening may provide different contextual information from one occurring during strong technology leadership.
The indicator does not determine whether a trade should be entered. Entry, exit, risk management, market structure, liquidity, volatility, news conditions, and other factors remain separate trading decisions.
---
# Alerts
Three state-change alerts are available:
* Technology leadership becomes positive
* Technology leadership becomes negative
* Leadership becomes mixed
Alerts trigger when the composite state transitions into the corresponding condition.
---
# Repainting / Realtime Behavior
The indicator is designed without future-data references.
All external symbol requests use `lookahead_off`, and the script does not reference future bars or negative offsets.
However, values on the **currently forming realtime bar can change until that bar closes**, because the underlying markets and market internals are still updating.
Historical completed bars represent the final calculated state for those completed chart bars.
Users who require confirmed information should therefore evaluate the state after the relevant bar has closed.
---
# Data Availability
The indicator depends on external TradingView symbols.
Price mode requires valid data for the selected Price Leader and Price Benchmark.
Volume Pressure mode requires valid data for the selected market-internal symbols.
Availability of individual symbols can vary depending on TradingView data access, exchange coverage, account configuration, or symbol availability.
If the required data is unavailable, the indicator reports that state rather than attempting to substitute another source automatically.
---
# Originality
Tech Leadership Map combines two distinct approaches to relative-market analysis inside one standardized leadership framework.
Rather than displaying QQQ/SPY relative strength or market internals as isolated raw series, the indicator evaluates several independent characteristics of leadership and converts them into a transparent four-vote Composite Score.
The Price model evaluates:
* session-relative performance
* relative-strength trend
* relative momentum
* correlation-based confirmation
The Volume Pressure model independently evaluates:
* normalized internal pressure
* smoothed pressure leadership
* internal momentum
* pressure impulse
Both engines produce the same standardized leadership states, allowing users to compare price-based leadership with non-price market-internal participation using a consistent visual framework.
The complete Pine Script source code is published openly so users can inspect the calculations and understand exactly how each state is derived.
---
## Important Notes
This indicator is an analytical tool and is not intended to provide investment advice or guarantee future market performance.
Leadership describes a relative condition between the selected markets or market internals. It should not be interpreted as a prediction that the charted instrument must rise or fall.
Users should evaluate the indicator together with their own analysis, trading methodology, and risk-management process.
Tech Leadership Map is a relative-market leadership indicator designed to show whether technology-focused market activity is currently leading, lagging, or moving without a clear advantage relative to the broader US equity market.
The indicator does not generate traditional buy or sell signals. Instead, it provides an additional market-context layer that can help traders evaluate whether current market participation supports or conflicts with the directional move they are analyzing.
It includes two selectable and independent leadership models:
* **Price**
* **Volume Pressure**
Both models convert several measurements into a standardized four-component composite score.
---
Why Tech Leadership Matters
Technology shares represent an important component of US equity index activity, particularly for Nasdaq-related instruments.
When technology is outperforming the broader market, Nasdaq-focused markets may be receiving stronger relative participation. When technology is underperforming, broader-market strength may not be confirmed by technology leadership.
This indicator attempts to make that relationship easier to observe directly on the chart.
It should be treated as a **relative-market context tool**, not as a standalone forecasting system.
---
Leadership States
The indicator evaluates four separate components.
Each component contributes:
**+1** = favors the selected technology leader
**0** = neutral / unavailable confirmation
**-1** = favors the benchmark
The resulting Composite Score can therefore range from:
**+4 to -4**
The default classification is:
**GREEN — Tech Leading**
Composite Score of +2 or higher.
Technology-oriented activity is showing stronger relative leadership than the selected benchmark.
**YELLOW — No Clear Edge**
Composite Score between -1 and +1.
The measurements are mixed and neither side has sufficient agreement to establish a clear leadership state.
**RED — Tech Lagging**
Composite Score of -2 or lower.
Technology-oriented activity is showing weaker relative leadership than the selected benchmark.
These colors describe the current relative-leadership condition. They do not represent predictions of future price direction.
---
# 1. PRICE MODE
The default Price model compares:
**QQQ — Price Leader**
with
**SPY — Price Benchmark**
Both symbols can be changed in the indicator settings.
The model evaluates four components.
### 1. Performance From RTH Open
The indicator measures the percentage performance of QQQ and SPY from the beginning of the configured US Regular Trading Hours session.
It then compares those performances.
If QQQ has performed better from the RTH open, the component favors the leader.
If SPY has performed better, it favors the benchmark.
---
### 2. Relative-Strength Ratio Slope
The indicator calculates the relative-strength relationship:
**QQQ / SPY**
The logarithm of this ratio is evaluated using a linear-regression slope.
A rising relative-strength relationship indicates improving technology leadership.
A falling relationship indicates weakening technology leadership relative to the benchmark.
---
### 3. Short-Term Momentum Difference
The model compares short-term rate-of-change momentum between the leader and benchmark.
By default, this component uses a 5-bar momentum comparison.
This allows the indicator to identify situations where both markets may be moving in the same direction while one is accelerating more strongly than the other.
---
### 4. Correlation-Break Confirmation
QQQ and SPY normally exhibit a relatively high degree of correlation.
The indicator measures correlation between their logarithmic returns.
When correlation falls below the model's internal threshold, the short-term momentum difference receives an additional confirmation vote.
The purpose of this component is to emphasize periods where relative movement becomes more meaningful because the two markets are no longer behaving as closely together.
---
# 2. VOLUME PRESSURE MODE
Volume Pressure provides an alternative model that does **not use QQQ/SPY price movement to determine leadership**.
The default market-internal sources are:
**NASDAQ: VOLDQ**
versus
**Broad Market / NYSE: VOLD**
These represent net up-volume minus down-volume market internals.
The symbols are editable because VOLDQ and VOLD represent different market universes and should not be interpreted as literal constituent-by-constituent equivalents of QQQ and SPY.
---
## Normalization
NASDAQ and broad-market internal series can operate on substantially different numerical scales.
For that reason, the indicator first normalizes each series independently before comparing them.
This prevents the raw numerical magnitude of one internal from automatically dominating the comparison.
---
## Volume Pressure Components
The model then evaluates four measurements.
### 1. Pressure Level
Compares the current normalized leader pressure with the normalized benchmark pressure.
---
### 2. Fast Pressure
Applies short-term smoothing to both normalized internal series and compares their relative position.
This helps reduce some bar-to-bar noise while preserving short-term changes in leadership.
---
### 3. Pressure Momentum
Measures the change in normalized internal pressure over the selected momentum lookback.
This identifies which market internal is currently improving or deteriorating faster.
---
### 4. Pressure Impulse
Each normalized internal is compared with its own slower baseline.
The difference between those impulses determines which market is showing the stronger deviation from its recent baseline.
---
# Chart Display
The default visualization uses colored dots placed along the chart.
The colors correspond directly to the current leadership state:
**Green = Tech Leading**
**Yellow = No Clear Edge**
**Red = Tech Lagging**
Optional chart-bar coloring can also be enabled.
By default, leadership dots are displayed only during the configured US Regular Trading Hours session:
**09:30–16:00 New York time**
This behavior can be changed in the settings.
---
# Statistics Table
The optional statistics table provides additional information about the active model.
Depending on the selected source, it displays:
* active leadership source
* current leadership state
* Composite Score
* individual component votes
* correlation in Price mode
* normalized internal gap in Volume Pressure mode
The table is intended to make the calculation transparent rather than displaying only the final color.
---
# How to Use It
The indicator is primarily intended as a **confirmation and market-context tool**.
For example, when analyzing a Nasdaq-related market, a trader may compare the current directional setup with the technology leadership state.
A bullish market setup occurring while technology is leading represents a different relative-market environment from the same setup occurring while technology is lagging.
Similarly, a bearish setup occurring while technology leadership is weakening may provide different contextual information from one occurring during strong technology leadership.
The indicator does not determine whether a trade should be entered. Entry, exit, risk management, market structure, liquidity, volatility, news conditions, and other factors remain separate trading decisions.
---
# Alerts
Three state-change alerts are available:
* Technology leadership becomes positive
* Technology leadership becomes negative
* Leadership becomes mixed
Alerts trigger when the composite state transitions into the corresponding condition.
---
# Repainting / Realtime Behavior
The indicator is designed without future-data references.
All external symbol requests use `lookahead_off`, and the script does not reference future bars or negative offsets.
However, values on the **currently forming realtime bar can change until that bar closes**, because the underlying markets and market internals are still updating.
Historical completed bars represent the final calculated state for those completed chart bars.
Users who require confirmed information should therefore evaluate the state after the relevant bar has closed.
---
# Data Availability
The indicator depends on external TradingView symbols.
Price mode requires valid data for the selected Price Leader and Price Benchmark.
Volume Pressure mode requires valid data for the selected market-internal symbols.
Availability of individual symbols can vary depending on TradingView data access, exchange coverage, account configuration, or symbol availability.
If the required data is unavailable, the indicator reports that state rather than attempting to substitute another source automatically.
---
# Originality
Tech Leadership Map combines two distinct approaches to relative-market analysis inside one standardized leadership framework.
Rather than displaying QQQ/SPY relative strength or market internals as isolated raw series, the indicator evaluates several independent characteristics of leadership and converts them into a transparent four-vote Composite Score.
The Price model evaluates:
* session-relative performance
* relative-strength trend
* relative momentum
* correlation-based confirmation
The Volume Pressure model independently evaluates:
* normalized internal pressure
* smoothed pressure leadership
* internal momentum
* pressure impulse
Both engines produce the same standardized leadership states, allowing users to compare price-based leadership with non-price market-internal participation using a consistent visual framework.
The complete Pine Script source code is published openly so users can inspect the calculations and understand exactly how each state is derived.
---
## Important Notes
This indicator is an analytical tool and is not intended to provide investment advice or guarantee future market performance.
Leadership describes a relative condition between the selected markets or market internals. It should not be interpreted as a prediction that the charted instrument must rise or fall.
Users should evaluate the indicator together with their own analysis, trading methodology, and risk-management process.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.