Structured Trend Score + EMA Entry Distance (%)This indicator is a decision-support tool designed to summarize market conditions into a single, readable “Trend Score” and to show how far the current price is from a reference EMA-based entry zone. It does not predict the future. It helps you structure a repeatable checklist: trend strength, momentum context, and distance to a potential entry level.
How the Trend Score works: the script combines four simple components into a 0–100 score. It compares a fast SMA to a slow SMA to gauge trend direction, uses RSI(14) to measure momentum, checks whether price is above the key moving averages to confirm alignment, and adds a small volatility term based on ATR(14) relative to price. The result is then smoothed with an SMA(20) of the score to reduce noise. In practice, higher values indicate stronger bullish alignment, lower values indicate stronger bearish pressure, and mid-range values often reflect mixed or transitional conditions.
How to read and use the Trend Score: the background shading is a quick visual filter. Values at or below 35 highlight weak/bearish conditions, while values at or above 65 highlight strong/bullish conditions. Crosses of the score above or below its own SMA(20) can be used as a simple “regime change” signal: a cross above suggests improving conditions, and a cross below suggests deterioration. The threshold alerts (above the bullish threshold or below the bearish threshold) are best used as confirmations, not as standalone entry triggers.
EMA Entry/TP logic and distance: the indicator also calculates a base EMA, either on the current timeframe or on a higher timeframe (for example Weekly) if you enable HTF mode. From that EMA, it derives two price levels using multipliers: an “Entry level” and a “TP level.” The key output is the absolute distance in percent between the current close and the Entry level. This is plotted as a separate line and summarized in the table, tagged as NEAR, MID, or FAR depending on your proximity thresholds. This is useful for timing: you can require both a favorable trend regime and a sufficiently small distance to your preferred entry zone before acting.
A practical workflow many traders use with this tool: first, filter direction with the Trend Score (avoid longs when the score is persistently low, avoid shorts when it is persistently high). Second, wait for the score to stabilize or cross its SMA(20) in the direction you want. Third, use the “Distance % to Entry” to avoid chasing price: only consider execution when the distance is NEAR or MID, based on your own plan. Finally, use alerts to reduce screen time: threshold alerts for regime confirmation, and the “near entry” alert to catch pullbacks into your entry zone.
Important constraints and common pitfalls: the Entry/TP multipliers define levels far away from the EMA if you choose extreme values. For example, an entry multiplier of 0.7 means the entry level is 30% below the EMA, which is very deep for most liquid markets. Make sure your multipliers make sense for the asset and timeframe you trade. Also, if you enable HTF EMA, the entry reference changes more slowly; this can be beneficial for swing trading, but it can feel “laggy” for intraday scalping. Finally, this indicator is not a full strategy: it does not include position sizing, invalidation rules, or risk management. Those must be defined separately and applied consistently.
In short, use this script to standardize your market read: Trend Score for direction and regime, and Entry Distance (%) for timing and discipline. It is most effective when integrated into a rule-based trading plan rather than used as a signal generator in isolation.
Pine Script® indicator





















