OPEN-SOURCE SCRIPT
AH Analyst v1

AH Analyst brings analyst recommendations, price targets and earnings expectations into one report on your chart. The table summarizes the latest available data, while chart markers let you read the same information by hovering over the relevant dates.
AH Analyst is a free, open-source indicator shared as a contribution to the TradingView community. You can explore the source code and adapt it to your own needs.
Reading the report
The heading shows the symbol and currency, followed by the company name and sector. The report has four sections: Analyst ratings, Price targets, Last earnings and Next earnings.
Colors describe individual fields, not an overall company rating. Blue indicates neutral information. A dash and pale square indicate unavailable data; missing values are not replaced with zero.
Analyst ratings
Strong buy, Buy, Hold, Sell and Strong sell show the latest recommendation counts. Recommendations is their total. Buy counts are green, sell counts are red and Hold is blue; zero counts remain blue.
Buy share combines Strong buy and Buy. Sell share combines Strong sell and Sell. Hold share covers Hold alone. Each is expressed as a percentage of the recommendation total. These are shares of the available opinions, not percentile rankings or probabilities.
For example, 25 buy recommendations out of 36 give a Buy share of 69.44%. Shares are displayed only when all five counts are available and agree with the total. Set date identifies the recommendation set.
Price targets
Target low, Target high, Target median and Target average show the provider's latest annual price targets. In the table, targets above the reference price are green, those below it are red, and equal values are blue.
Median gap and Average gap show the percentage difference from the reference price: (target / reference price − 1) × 100. These percentages measure distance, not the likelihood of reaching a target.
Target estimates shows the number of estimates in this set. Its count and Set date can differ from the recommendation set because ratings and price targets are separate datasets.
Reference price is the latest standard-chart close on the selected timeframe. Reference date is that bar's date. The price and percentage gaps can change with the market and chart timeframe.
Last earnings
Reported EPS is compared with its associated Estimated EPS. Green means the reported result exceeded the estimate; red means it fell below. Blue means equality or an unavailable comparison.
EPS surprise is Reported EPS minus Estimated EPS. Surprise % divides that difference by the absolute estimate and multiplies by 100. A zero estimate has no percentage result. Displayed amounts are rounded, so calculations using only the visible figures can differ slightly.
Standardized EPS is shown separately because its accounting basis can differ. Observed date identifies the chart bar where the earnings data was received, rather than a guaranteed exact announcement time.
Next earnings
Expected EPS and Expected revenue show estimates for the next report. Period end is the fiscal period covered; Report date is the expected announcement date. Estimates and dates can change and remain neutral blue in the table.
On the chart
Ratings, Targets, EPS and Next EPS markers remain visible when the report is hidden. Hover over them to read recommendation counts, target prices or earnings figures. The triangles point to the associated bars; they are not buy or sell signals.
Date markers use the available chart bars. A non-trading date may appear on the next trading day, while weekly and monthly charts group dates into larger bars. The tooltip retains the source date for Ratings and Targets.
The optional target box runs from the target-set date to the next earnings report date. High and Low form its dotted outer boundary; Median and Average appear as dashed lines inside. The four price labels identify these levels. The box ends at the earnings date for display purposes; this is not the expiry date of the annual targets.
Chart targets share one adjustable color, with a separate background color. Missing or invalid dates prevent the box from being drawn. Extreme targets and closely spaced levels can affect chart readability.
Inputs
• Show report: Shows or hides the table.
• Position: Places the table at one of nine chart positions; Top Right is the default.
• Text size: Adjusts the report text.
• Label color: Adjusts field labels, company identity and chart-marker text.
• Title color: Adjusts report and section headings.
• Background color: Adjusts table backgrounds. Increase opacity if candles interfere with readability.
• Highlight color: Adjusts heading backgrounds.
• Targets: Shows or hides the target box and its levels; off by default.
• Event text size: Adjusts Ratings, Targets, EPS and Next EPS text; default 12.
• Target text size: Adjusts High, Low, Median and Average labels; default 8.
• Border color: Sets one color for the target-box border, internal lines and price labels; purple by default.
• Background color (Chart): Adjusts the target-box fill; default transparency 97. Set it to 100 for an empty interior.
Company identity and assessment squares are always included in the report. Amounts use the symbol's native currency. Further presentation changes can be made in the source code.
Data and interpretation
Availability depends on the symbol and TradingView's data provider. Some stocks have incomplete analyst coverage or earnings estimates. Missing information stays unavailable.
The indicator displays the latest supplied analyst snapshots, not a history of individual analysts or brokerage decisions. Data and expected report dates may be revised. Chart replay does not establish when the current analyst snapshot first became available.
Use standard daily candlesticks as a reference when comparing data. Other timeframes can change the reference price and the bars associated with earnings observations. Converted price scales may not match the native-currency target drawings.
AH Analyst organizes third-party information for easier reading. Analyst opinions and targets are not recommendations generated by this indicator. This is not investment advice.
AH Analyst is a free, open-source indicator shared as a contribution to the TradingView community. You can explore the source code and adapt it to your own needs.
Reading the report
The heading shows the symbol and currency, followed by the company name and sector. The report has four sections: Analyst ratings, Price targets, Last earnings and Next earnings.
Colors describe individual fields, not an overall company rating. Blue indicates neutral information. A dash and pale square indicate unavailable data; missing values are not replaced with zero.
Analyst ratings
Strong buy, Buy, Hold, Sell and Strong sell show the latest recommendation counts. Recommendations is their total. Buy counts are green, sell counts are red and Hold is blue; zero counts remain blue.
Buy share combines Strong buy and Buy. Sell share combines Strong sell and Sell. Hold share covers Hold alone. Each is expressed as a percentage of the recommendation total. These are shares of the available opinions, not percentile rankings or probabilities.
For example, 25 buy recommendations out of 36 give a Buy share of 69.44%. Shares are displayed only when all five counts are available and agree with the total. Set date identifies the recommendation set.
Price targets
Target low, Target high, Target median and Target average show the provider's latest annual price targets. In the table, targets above the reference price are green, those below it are red, and equal values are blue.
Median gap and Average gap show the percentage difference from the reference price: (target / reference price − 1) × 100. These percentages measure distance, not the likelihood of reaching a target.
Target estimates shows the number of estimates in this set. Its count and Set date can differ from the recommendation set because ratings and price targets are separate datasets.
Reference price is the latest standard-chart close on the selected timeframe. Reference date is that bar's date. The price and percentage gaps can change with the market and chart timeframe.
Last earnings
Reported EPS is compared with its associated Estimated EPS. Green means the reported result exceeded the estimate; red means it fell below. Blue means equality or an unavailable comparison.
EPS surprise is Reported EPS minus Estimated EPS. Surprise % divides that difference by the absolute estimate and multiplies by 100. A zero estimate has no percentage result. Displayed amounts are rounded, so calculations using only the visible figures can differ slightly.
Standardized EPS is shown separately because its accounting basis can differ. Observed date identifies the chart bar where the earnings data was received, rather than a guaranteed exact announcement time.
Next earnings
Expected EPS and Expected revenue show estimates for the next report. Period end is the fiscal period covered; Report date is the expected announcement date. Estimates and dates can change and remain neutral blue in the table.
On the chart
Ratings, Targets, EPS and Next EPS markers remain visible when the report is hidden. Hover over them to read recommendation counts, target prices or earnings figures. The triangles point to the associated bars; they are not buy or sell signals.
Date markers use the available chart bars. A non-trading date may appear on the next trading day, while weekly and monthly charts group dates into larger bars. The tooltip retains the source date for Ratings and Targets.
The optional target box runs from the target-set date to the next earnings report date. High and Low form its dotted outer boundary; Median and Average appear as dashed lines inside. The four price labels identify these levels. The box ends at the earnings date for display purposes; this is not the expiry date of the annual targets.
Chart targets share one adjustable color, with a separate background color. Missing or invalid dates prevent the box from being drawn. Extreme targets and closely spaced levels can affect chart readability.
Inputs
• Show report: Shows or hides the table.
• Position: Places the table at one of nine chart positions; Top Right is the default.
• Text size: Adjusts the report text.
• Label color: Adjusts field labels, company identity and chart-marker text.
• Title color: Adjusts report and section headings.
• Background color: Adjusts table backgrounds. Increase opacity if candles interfere with readability.
• Highlight color: Adjusts heading backgrounds.
• Targets: Shows or hides the target box and its levels; off by default.
• Event text size: Adjusts Ratings, Targets, EPS and Next EPS text; default 12.
• Target text size: Adjusts High, Low, Median and Average labels; default 8.
• Border color: Sets one color for the target-box border, internal lines and price labels; purple by default.
• Background color (Chart): Adjusts the target-box fill; default transparency 97. Set it to 100 for an empty interior.
Company identity and assessment squares are always included in the report. Amounts use the symbol's native currency. Further presentation changes can be made in the source code.
Data and interpretation
Availability depends on the symbol and TradingView's data provider. Some stocks have incomplete analyst coverage or earnings estimates. Missing information stays unavailable.
The indicator displays the latest supplied analyst snapshots, not a history of individual analysts or brokerage decisions. Data and expected report dates may be revised. Chart replay does not establish when the current analyst snapshot first became available.
Use standard daily candlesticks as a reference when comparing data. Other timeframes can change the reference price and the bars associated with earnings observations. Converted price scales may not match the native-currency target drawings.
AH Analyst organizes third-party information for easier reading. Analyst opinions and targets are not recommendations generated by this indicator. This is not investment advice.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.