OPEN-SOURCE SCRIPT
Zaktualizowano

Offence vs Defence Intraday Histogram

The "Offence vs Defence Intraday Histogram" script is designed to analyze market sentiment by comparing the performance of offensive and defensive ETFs within a single trading day. This script provides a cumulative histogram that highlights the net impact of offensive and defensive ETF movements, helping traders identify significant shifts and trends within a trading day.

How It Works:

ETF Selection: The script focuses on three offensive ETFs (XLK, XLC, XLY) and three defensive ETFs (XLU, XLV, XLP) to represent market sentiment.

Percentage Change Calculation: The script calculates the percentage change for each ETF compared to the previous bar.

Smoothing with EMA: A 50-period Exponential Moving Average (EMA) is applied to the percentage changes to smooth out short-term volatility and provide a clearer trend.

Offence vs Defence Difference: The script calculates the difference between the smoothed offensive and defensive values.

Cumulative Difference: The cumulative difference is calculated throughout the trading day and resets at the start of each new trading day.

Histogram Plotting: The cumulative difference is plotted as a histogram, with green bars indicating an increasing cumulative difference and red bars indicating a decreasing cumulative difference.

Significance Labels: Color-coded labels are added to highlight significant values, with thresholds set for minor, moderate, and significant leads for both offensive and defensive ETFs.

Key Features:

Intraday sentiment analysis using offensive and defensive ETFs.

Cumulative histogram to visualize net impact within a trading day.

EMA smoothing to reduce noise and highlight trends.

Color-coded histogram bars for easy interpretation.

Labels indicating significant leads in offensive or defensive ETFs.

This script helps traders and investors better understand market sentiment and make more informed decisions based on the intraday performance of offensive and defensive sectors.
Informacje o Wersji

The "Offence vs Defence Intraday Histogram" script is designed to analyze market sentiment by comparing the performance of offensive and defensive ETFs within a single trading day. This script provides a cumulative histogram that highlights the net impact of offensive and defensive ETF movements, helping traders identify significant shifts and trends within a trading day.

How It Works:

ETF Selection: The script focuses on three offensive ETFs (XLK, XLC, XLY) and three defensive ETFs (XLU, XLV, XLP) to represent market sentiment.

Percentage Change Calculation: The script calculates the percentage change for each ETF compared to the previous bar.

Smoothing with EMA: A 50-period Exponential Moving Average (EMA) is applied to the percentage changes to smooth out short-term volatility and provide a clearer trend.

Offence vs Defence Difference: The script calculates the difference between the smoothed offensive and defensive values.

Cumulative Difference: The cumulative difference is calculated throughout the trading day and resets at the start of each new trading day.

Histogram Plotting: The cumulative difference is plotted as a histogram, with green bars indicating an increasing cumulative difference and red bars indicating a decreasing cumulative difference.

Significance Labels: Color-coded labels are added to highlight significant values, with thresholds set for minor, moderate, and significant leads for both offensive and defensive ETFs.

Key Features:

Intraday sentiment analysis using offensive and defensive ETFs.

Cumulative histogram to visualize net impact within a trading day.

EMA smoothing to reduce noise and highlight trends.

Color-coded histogram bars for easy interpretation.

Labels indicating significant leads in offensive or defensive ETFs.

This script helps traders and investors better understand market sentiment and make more informed decisions based on the intraday performance of offensive and defensive sectors

Wyłączenie odpowiedzialności