Global Market Sentiment
- Indicatori
- Raka
- Versione: 1.0
Global Market Risk Sentiment Meter
1. Overview
The Global Market Risk Sentiment Meter is an analytical indicator designed for the MetaTrader 5 (MQL5) platform. It employs an Inter-Market Analysis approach to assess the aggregate data of specific global financial markets. By evaluating real-time price changes across US Indices, Global Equities, Cryptocurrencies, and historical Safe Haven assets (Gold and the US Dollar Index), the indicator calculates a composite sentiment score. This data is visualized through a custom-drawn graphical meter on the chart, providing an ongoing display of measured risk appetite. The indicator features a dynamic symbol mapping function that automatically adapts to various broker symbol naming conventions to maintain calculation stability.
2. Technological Architecture
The indicator is structured upon an Object-Oriented Programming (OOP) architecture, natively utilizing the MQL5 language standard libraries.
A. Graphical Rendering
The visual interface is constructed using the standard MQL5 CCanvas and Bitmap libraries to process visual elements efficiently without cluttering the chart with standard graphical objects.
-
Gradient Interpolation: The graphical arc utilizes linear interpolation algorithms to render a color gradient. It transitions from Crimson (representing lower risk appetite/Fear) to Gold (Neutral) and Lime Green (representing higher risk appetite/Greed) based on mathematical values.
-
Trigonometric Rendering: The indicator calculates needle movement and arc segments using native MQL5 trigonometric functions (Sine/Cosine), mapping the 0-100 data scale to a semi-circular radian coordinate system.
B. Responsive Layout Positioning
The on-chart dashboard includes a responsive layout process driven by the OnChartEvent handler. It supports six predefined anchor positions. It utilizes an anchoring function that reads absolute pixel coordinates based on the current chart window dimensions. This calculates the vertical and horizontal offsets dynamically to keep the graphical elements visible during terminal window resizing.
3. Functional Logic and Calculation Methodology
The primary function of the indicator is to quantify the relative price performance of risk-oriented assets versus defensive assets.
A. Multi-Asset Calculation
The numerical score is derived from evaluating the relative movements of four distinct asset categories:
-
US Equities: Evaluates major benchmark indices (S&P 500, NASDAQ 100, Dow Jones Industrial Average equivalents).
-
Global Equities: Evaluates international market proxies (DAX, FTSE, Nikkei equivalents).
-
Cryptocurrencies: Evaluates major market cap digital assets like Bitcoin and Ethereum.
-
Safe Havens: Evaluates defensive assets such as Gold (XAUUSD) and the US Dollar Index (DXY) equivalents.
B. Data Smoothing and Normalization
The raw calculated score is processed using an Exponential Moving Average (EMA) mathematical model to smooth out short-term tick fluctuations. The final output is normalized to a fixed scale of 0 to 100, grouped into the following observational zones:
-
0 - 25: Extreme Fear (Historically oversold conditions / Risk-off environment)
-
25 - 45: Fear (Negative sentiment bias)
-
45 - 55: Neutral (Market consolidation or transition)
-
55 - 75: Greed (Positive sentiment bias)
-
75 - 100: Extreme Greed (Historically overbought conditions / Risk-on environment)
4. Usage Guide
Installation and Setup
-
Attach the indicator to any chosen chart. The H1 or H4 timeframes are commonly used for observing broader sentiment data.
-
Position: Select the desired visual location from the inputs (e.g., POS_UPPER_RIGHT).
-
Radius: Adjust the physical size of the graphical gauge in pixels (default is 100).
-
Historical Period: Define the smoothing period for the EMA calculation (default is 14).
-
Requirement: Ensure that the required symbols (major indices, crypto, and commodities) are active and visible in your terminal's Market Watch window so the MQL5 symbol functions can retrieve the necessary price data.
Data Interpretation
-
Sentiment Extremes: Values dropping below 20 (Extreme Fear) historically indicate broad market sell-offs, which traders often observe for potential support areas. Conversely, values exceeding 80 (Extreme Greed) indicate broad buying momentum, which traders observe for potential resistance or market exhaustion points.
-
Trend Context: Readings consistently maintained in the 60-75 zone mathematically indicate a prevailing risk-on environment. Traders may use this data alongside price-action analysis to validate current market structures.
-
Divergence Observation: If a specific asset reaches new price highs while the composite Sentiment Meter fails to increase or declines toward Neutral, it statistically indicates a reduction in aggregate market momentum.
Visual Indicators
-
Red Zone: Reflects an environment where analyzed capital flows towards defensive assets.
-
Green Zone: Reflects an environment where analyzed capital flows towards risk and equity assets.
-
Needle Position: Continuously updates according to the chart's tick data, displaying the current calculated composite value.

Good indicator, thank you for sharing...