PROTECTED SOURCE SCRIPT

EMA Hierarchy Score V.1.0

Updated

EMA Hierarchy Score V.1.0

Purpose

The EMA Hierarchy Score indicator assesses the relative positioning of multiple Exponential Moving Averages (EMAs) for a financial asset. This tool provides insights into trend strength by calculating ideal and non-ideal configurations of EMAs, allowing for effective interpretation when used alongside standard EMA charts.

Variables and Inputs

The indicator organizes a set of EMAs and other metrics into a hierarchy for scoring:

* Primary Variables (A–J):
A: Close price
B: Open price
C: Previous close price
D to J: EMAs of configurable periods (5, 9, 13, 21, 26, 52, 100).
* User Inputs:
* Customizable periods for each EMA, allowing users to adjust the indicator’s sensitivity.
* Customizable period and standard deviation multiplier for Bollinger Bands, enabling further control over the indicator’s analysis.

Mathematical Method

The EMA Hierarchy Score calculates how closely the current EMA structure aligns with an “ideal” configuration through a structured scoring system:

1- Hierarchy Scoring:

* Ideal Order: Defined as A > B > C > D > E > F > G > H > I > J, representing a strong upward trend where each EMA progressively increases.
* Non-Ideal Order: Defined as J > I > H > G > F > E > D > C > B > A, indicating a weak or downward trend where each EMA progressively decreases.
* Optimal Order: Calculated based on achieving maximum alignment with the ideal configuration for each EMA across the chosen period.
* Sub-Optimal Order: The least-aligned structure across the same period.

2- Score Calculation:

* The indicator calculates a score by comparing all EMA pairs in values. For each comparison, a score increment of +1 (ideal) or -1 (non-ideal) is applied.
* The final score reflects the EMA configuration’s deviation from the ideal order:
- Positive Score: Indicates closer alignment with the ideal structure.
- Negative Score: Indicates deviation toward a non-ideal structure.

3- Smoothed and Signal Lines:

* A smoothed score is created using a Simple Moving Average (SMA) of the raw hierarchy score.
* A signal line (an SMA of the smoothed score) further aids in tracking directional shifts in the score.

4- Trend Labels and Bollinger Bands:

* Trend Labels: Display "UP" or "DOWN" based on the smoothed score’s relationship to the signal line.
* Bollinger Bands: Plotted around a selected source (smoothedLine, signalLine, or score) to analyze score volatility and deviations from the mean. The period and standard deviation multiplier for Bollinger Bands are user-configurable.

Result Definition

The Ideal and Non-Ideal Scores represent the upper and lower bounds of achievable configurations, ensuring the score does not exceed these values.

1- Ideal and Non-Ideal Result:

* Calculated based on how closely the current EMA configuration follows the “ideal” ascending or descending order.
* Ideal Score: Defined as +165, representing perfect alignment with the ideal configuration.
* Non-Ideal Score: Defined as -165, indicating full alignment with the descending, non-ideal structure.
* The score is bounded by these values and will not go above or below this range.

2- Optimal and Sub-Optimal Scores:

* Optimal Score: The highest score over the selected scoring period, calculated with the same period as the Bollinger Bands. Using consistent periods reinforces the reliability of the score by aligning with the period already used to gauge volatility.
* Sub-Optimal Score: The lowest score over the same period, capturing points of minimal alignment with the ideal order.

Interpretation and Analysis

1- Use with EMA Charts:

* This indicator is designed to be used alongside EMA charts, as its results provide insights into the relative order of EMAs and their alignment with trend strength.
* The EMA Hierarchy Score interprets the underlying EMA structure, offering additional context on whether current trends are aligned with optimal or non-optimal EMA configurations.

2- Ideal and Non-Ideal Analysis:

* A positive EMA Hierarchy Score indicates an orderly, ideal upward trend, suggesting stronger alignment with the ideal structure.
* A negative score signals a potential downward trend or deviation from the ideal structure.

3 - Trend Indicators and Bands:

* Trend Labels: The "UP" and "DOWN" labels offer real-time feedback on trend direction shifts, based on the smoothed score and signal line relationship.
* Bollinger Bands: Visualize the range of score fluctuations, helping to identify breakout or breakdown points.

4 - Optimal and Sub-Optimal Scores:

* Use the Optimal Score to understand peak trend alignment and Sub-Optimal Score to spot potential reversal or correction zones.
* A consistently high score over time indicates trend stability, while variations may suggest instability.

Quick Reference Table

The table displayed at the top right provides an at-a-glance view of key metrics:

* Ideal and Non-Ideal Score: Fixed at ±165 to represent the calculated ideal and non-ideal configuration.
* Optimal and Sub-Optimal Scores: Show maximum and minimum scores over the scoring period, color-coded green for positive and red for negative values.
This concise table helps users quickly assess indicator values, reducing the need to interpret multiple chart lines and making it easier to understand overall trend strength.

Disclaimer

The EMA Hierarchy Score V.1.0 is a technical analysis tool designed to assist in understanding the alignment and strength of trends as defined by EMA configurations. This indicator does not constitute investment advice, nor does it make specific recommendations for buying or selling assets. Users should consult with a financial advisor before making any trading decisions, as past performance or technical signals do not guarantee future results. The developers of this indicator disclaim all liability for potential financial losses arising from reliance on this tool. Users assume full responsibility for interpreting and applying the indicator’s outputs in their investment decisions.
Release Notes

Purpose
The EMA Hierarchy Score indicator is an advanced tool for analyzing market trends by assessing the relative positioning of Exponential Moving Averages (EMAs). This indicator provides a structured scoring system to quantify trend alignment and strength. By evaluating "ideal" and "non-ideal" configurations of EMAs, it offers traders actionable insights for interpreting market dynamics, enhancing traditional EMA chart analysis.

snapshot

---------------------------------------------------------------------------------------------------------------------
Key Concepts

EMA Hierarchy:

EMAs represent a series of averages calculated for specific periods to identify trends in market data.
The EMA Hierarchy Score organizes EMAs into a ranked structure to analyze their alignment and configuration.
Ideal and Non-Ideal Configurations:

An Ideal Order (e.g., EMA-5 > EMA-9 > EMA-13 > ... > EMA-100) suggests strong bullish trends.
A Non-Ideal Order (e.g., EMA-100 > EMA-52 > ... > EMA-5) indicates bearish market sentiment.
Score System:

The score reflects the current EMA structure's deviation from the ideal configuration, providing clear trend signals:
Positive Score: Indicates alignment with an upward trend.
Negative Score: Suggests deviation toward a downward trend.

snapshot


---------------------------------------------------------------------------------------------------------------------
Features

Customizable Inputs:

Periods for EMAs can be configured to match a trader’s specific strategy or timeframe.
Bollinger Band parameters (period and standard deviation multiplier) are user-adjustable to fine-tune volatility analysis.
Real-Time Feedback:

The indicator dynamically calculates a hierarchy score based on the EMA structure and updates it in real-time.
"UP" or "DOWN" labels provide an instant summary of trend direction based on the relationship between smoothed and signal lines.
Integrated Bollinger Bands:

Plots Bollinger Bands around the smoothed score, enabling traders to visualize score volatility and identify breakout or breakdown zones.
Quick Reference Table:

Displays Ideal, Non-Ideal, Optimal, and Sub-Optimal Scores, color-coded for quick interpretation.

snapshot

---------------------------------------------------------------------------------------------------------------------
Mathematical Methodology
The EMA Hierarchy Score is built on a structured calculation process:

Hierarchy Scoring:

Pairwise comparisons of EMAs are made for their alignment in the ideal or non-ideal order.
For each pair:
+1 point is added for alignment with the ideal order.
-1 point is deducted for alignment with the non-ideal order.
Final Score:

The total score represents the EMA structure’s alignment:
Ideal Order: Maximum score of +165 (perfect bullish configuration).
Non-Ideal Order: Minimum score of -165 (complete bearish configuration).
Smoothing:

The raw score is smoothed using a Simple Moving Average (SMA) to reduce noise.
A secondary SMA (signal line) tracks directional shifts in the smoothed score.
Trend Labels and Bollinger Bands:

Trend labels (“UP” or “DOWN”) are based on the relationship between the smoothed score and signal line.
Bollinger Bands, applied to the smoothed score, highlight volatility and signal potential market breakouts.

snapshot

---------------------------------------------------------------------------------------------------------------------
Interpretation and Usage

Positive and Negative Scores:

Positive Score: Indicates a trend aligned with an ideal, upward configuration of EMAs.
Negative Score: Suggests a bearish or non-ideal configuration.
Optimal and Sub-Optimal Scores:

Optimal Score: Captures the highest trend alignment during the scoring period.
Sub-Optimal Score: Highlights periods of minimal trend alignment, suggesting possible trend reversals or corrections.
Using Bollinger Bands:

Bollinger Bands around the smoothed score help traders identify significant deviations from the mean and potential reversal points.
Trend Labels:

“UP” signals strong bullish alignment; “DOWN” indicates bearish momentum.

snapshot

---------------------------------------------------------------------------------------------------------------------
Quick Reference Table
A summary table is displayed at the top-right corner of the chart, providing:

Ideal and Non-Ideal Scores: Fixed at +165 and -165 to reflect perfect and non-perfect configurations.
Optimal and Sub-Optimal Scores: Dynamically calculated based on the scoring period.
Color-Coding: Green for positive values, red for negative values, and yellow for neutral trends.
---------------------------------------------------------------------------------------------------------------------
Example Workflow

Add the indicator to your chart and configure EMA periods as needed.
Observe the hierarchy score and trend labels to assess market alignment.
Use the Bollinger Bands to identify breakout zones or mean reversion opportunities.
Refer to the quick reference table to monitor trends at a glance.

snapshot

---------------------------------------------------------------------------------------------------------------------
Visualization Requirements
To maximize clarity, ensure the chart displays:

EMA Hierarchy Score output, including smoothed and signal lines.
Trend labels ("UP" or "DOWN") to reflect directional shifts.
Bollinger Bands around the smoothed line for volatility analysis.
A clean layout without unrelated indicators or drawings, unless explicitly justified.

snapshot
---------------------------------------------------------------------------------------------------------------------
Disclaimer
The EMA Hierarchy Score V.1.0 is a technical analysis tool designed to assist traders in evaluating market trends. It does not provide financial advice or specific recommendations. Users should consult a financial advisor before making investment decisions. The developers disclaim all liability for financial losses arising from the use of this tool.
Bands and ChannelsBBbist100EMASemassignalhisseanalizMoving AveragestradingTrend AnalysistrendlineanalysisTrend Line BreakUSDTRY

Protected script

This script is published closed-source and you may privately use it freely.

Want to use this script on a chart?


Also on:

Disclaimer