OPEN-SOURCE SCRIPT

Alpha Forge Analyst Engine

385
Analyst conviction. Target-price reality. Valuation context. Directly on your chart.

The Analyst Engine is a market intelligence overlay designed to answer one important question:

Do analysts still support this stock at the current chart price?

Most traders see analyst ratings like Buy, Hold, or Strong Buy and stop there. But ratings alone are not enough. A stock can have bullish analyst coverage and still be trading near, or even above, the average analyst target.

Analyst Engine combines analyst recommendations, price targets, current chart price, target upside, median target confirmation, target range risk, and valuation context into one clean dashboard.

This is not a buy/sell signal system. It is a decision-support layer built to help traders understand whether analyst support still makes sense at today’s price.

What It Does

Analyst Engine evaluates:

Analyst recommendation strength
Buy consensus percentage
Total analyst coverage
Current price vs average target
Current price vs median target
High / low target range
Target upside and median upside
Target range quality
Low-target downside risk
Analyst target confidence
Basic valuation context such as P/E, P/S, and EPS when available

The result is a clear readout showing whether the stock is supported, volatile, cautious, over target, or lacking available Pine-accessible analyst data.

Core Question
Do analysts still support this stock at the current chart price?

The indicator does not simply show that analysts are bullish.

It checks whether that bullishness still matters relative to the live chart price.

Example:

A stock may have 90% buy consensus, but if price is already above the average analyst target, the engine can flag it as:

Over Target

Another stock may have strong upside, but if analyst targets are extremely spread out, the engine may classify it as:

Support / Volatile

That is the edge of this tool.

Key Features
Analyst Recommendation Engine

Displays available TradingView Pine-accessible analyst recommendation data, including:

Strong Buy
Buy
Hold
Sell / Strong Sell
Total coverage
Buy consensus %

This helps separate truly strong analyst support from mixed or weak coverage.

Target Price Reality Check

The engine compares the live chart price against:

Average analyst target
Median analyst target
High analyst target
Low analyst target

It then calculates:

Average target upside
Median target upside
Current price zone
Over-target condition
Low-target downside risk

This helps avoid blindly trusting ratings when price has already moved too far.

Median Target Confirmation

v2.0 uses the median target to help determine whether the average target is supported by the broader analyst group or potentially distorted by outliers.

For example:

Median confirms upside
The average and median targets are reasonably aligned.

Split target structure
Average and median targets disagree, or the high/low target range is extremely wide.

This adds an extra layer of quality control to analyst target data.

Target Confidence Layer

Not all analyst targets are equally useful.

The indicator evaluates target structure and classifies confidence as:

High
Medium
Volatile
Split

A stock with huge upside but a massive high/low target spread may not deserve high conviction. Alpha Forge adjusts the interpretation accordingly.

Bias + Decision System

The dashboard separates Bias from Decision.

Bias shows the broad analyst condition.

Decision gives a more practical interpretation after considering target upside, target quality, coverage, and valuation context.

Possible readings include:

Strong Support
Support
Support / Volatile
Strong Ratings
Ratings Only
Watch
Watch / Split
Caution
Over Target
No Pine Data
AF Grade System

The indicator includes two grade layers:

Overall Grade
A broader score that considers analyst conviction, target edge, target quality, momentum, and valuation context.

Analyst Grade
A more focused read on analyst support and target structure.

This helps users understand when analyst sentiment is strong but overall conditions are less clean due to valuation, target risk, or missing target data.

Valuation Context

When available, the engine also displays basic valuation/fundamental data:

EPS TTM
P/E ratio
P/S ratio
Revenue TTM
Basic valuation score

This is not intended to replace full fundamental analysis, but it gives helpful context beside analyst support.

Target Lines

By default, the indicator plots the average analyst target only.

High and low target lines can be enabled, but they are disabled by default because extreme targets can flatten the chart scale.

Available target line modes:

Average only
All targets
None

Available target label modes:

Average only
All labels
None

Dashboard Modes

The dashboard is customizable for desktop, tablet, and mobile use.

Available modes include:

Full
Classic Compact
Compact
Micro

Users can adjust:

Dashboard position
Text size
Label width
Dashboard transparency
Score row visibility
Fundamentals visibility
Target quality row visibility
Floating bias label position
Floating bias label size
Suggested Mobile Settings

For mobile, suggested settings are:

Dashboard Mode: Classic Compact
Dashboard Label Width: Narrow
Text Size: Small or Tiny
Target Line Mode: Avg Only
Target Label Mode: Avg Only
Floating Bias Label Position: Right of Price
Fundamentals: Off
How To Read It
Strong Support

Analysts are strongly bullish, price remains below the average target, and target upside is meaningful.

Support

Analysts still support the stock, but upside or conviction may be more moderate.

Support / Volatile

Analyst support exists and median target may confirm upside, but the target range is wide or uncertain.

Strong Ratings

Ratings are strongly positive, but price target data may not be available through Pine for that symbol.

Ratings Only

Recommendation data is available, but target-price data is unavailable.

Watch

Some support exists, but the edge is not clean enough.

Caution

Upside is weak, ratings are mixed, target structure is poor, or valuation context is stretched.

Over Target

Current price is above the average analyst target.

No Pine Data

TradingView may not expose analyst data to Pine Script for that symbol, even if analyst information appears elsewhere on the platform.

Important Data Note

Analyst data availability depends on what TradingView exposes to Pine Script for each symbol.

Some stocks may provide full analyst recommendation and target-price data. Others may provide ratings only. Some may show analyst data in TradingView’s interface but return no analyst data inside Pine.

The indicator is automatic-only by design. Manual analyst inputs are not included because manually entered data can become stale and may miss upgrades, downgrades, target raises, or target cuts.

Best Used For

Analyst Engine is best used as a confirmation and decision-support tool.

It pairs well with:

Trend-following systems
Momentum indicators
Breakout setups
Reversal tools
Swing trading strategies
Options watchlists
Long-term stock reviews

Use it to help answer:

Is this stock still supported by analysts at today’s price, or has the setup become stretched, uncertain, or over-target?

Disclaimer

This indicator is for educational and informational purposes only. Analyst ratings and target prices are estimates and can change at any time. They are not guarantees of future price movement.

Analyst Engine does not provide financial advice and should not be used as a standalone buy or sell signal. Always combine analyst data with price action, risk management, market conditions, and your own research.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.