OPEN-SOURCE SCRIPT

Median Analyst Consensus

The Median Analyst Consensus Indicator provides an unbiased, easy-to-interpret view of market sentiment by leveraging TradingView's comprehensive financial data library. This tool displays the median 12-month price target and the percentage difference from the current price directly on your charts.

Key Features
1. Accurate Market Sentiment: By consolidating analyst ratings and price targets from multiple reputable sources like Bloomberg, Refinitiv (formerly Thomson Reuters), S&P Capital IQ, and Morningstar, this indicator displays the median analyst consensus. Using the median ensures outlier ratings don't skew the overall sentiment, providing a more robust representation.
2. Simplicity at a Glance: View the median 12-month price target and percentage difference from the current price directly on your chart. No need to juggle multiple reports - key insights are surfaced within your normal trading workflow.
3. Data-Driven Transparency: If no analyst data is available for a particular asset, the indicator will not display, ensuring you only see reliable information. The number of contributing analysts is also shown for context.

Why the Median?
The median is favored over the mean to minimize the impact of outlier ratings that could distort the consensus view. By taking the middle value across all analyst projections, the median provides a more stable, outlier-resistant measure of market sentiment.

Powered by TradingView Data
This indicator taps into TradingView's financial data library, which aggregates analyst ratings, estimates, and recommendations from leading institutional data providers. TradingView sources this data from firms like FactSet, Bloomberg, Refinitiv, S&P Capital IQ, and Morningstar, ensuring a comprehensive and trusted view of analyst sentiment.

The library provides variables like:
  • syminfo.recommendations_buy
  • syminfo.recommendations_sell
  • syminfo.target_price_median
  • syminfo.recommendations_buy_strong
  • syminfo.recommendations_sell_strong

The indicator calculates and displays the median of these analyst inputs.

Usage
The indicator displays:
  • The median 12-month price target across analysts
  • The percentage difference between the price target and current price
  • The number of contributing analyst estimates

If no analyst data is available, the indicator does not display, ensuring full transparency.

The Median Analyst Consensus Indicator provides an unbiased, easy-to-interpret view of market sentiment by leveraging TradingView's comprehensive financial data library. This tool offers a new perspective on potential trade opportunities directly on your charts.

Disclaimer
While the data is sourced from reputable providers, analyst forecasts should not be construed as investment recommendations. This indicator aims to synthesize market opinions, but investment decisions are solely your responsibility. As with any analytical tool, you should conduct your own research and risk assessments before executing any trades.
















analystanalystsconsensusforecastforecastingjulien_echesentimentTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer