OPEN-SOURCE SCRIPT

SMEMA Trend Core

391
SMEMA Trend Core is a multi-timeframe trend analysis tool designed to provide a clean, adaptive and structured view of the market’s directional bias. It can be used in short term, swing or long term contexts. The internal calculation adjusts automatically based on the selected trading style, while always combining data from six timeframes.

At its core, the indicator uses a SMEMA, which is a Simple Moving Average applied to an EMA. This combination improves smoothness without losing reactivity. The SMEMA is calculated separately on 1H, 4H, 1D, 3D, 1W and 1M timeframes. These six values are then combined using dynamic weights that depend on the trading mode:
  • Short Term mode gives more influence to 1H and 4H
  • Swing Trading mode gives more influence to 1D, 3D and 1W
  • Long Term mode gives more influence to 1W and 1M


However, all six timeframes are always included in the final result. This avoids the tunnel vision of relying on a single resolution and ensures that the indicator captures both local and structural movements.

The result is a synthetic trend line, called Global SMEMA, that adapts to market conditions and offers a realistic view of the ongoing trend. To enhance the reading, the indicator calculates a Trend Score. This score reflects the position of price relative to the Global SMEMA, scaled by a long-term ATR, and adjusted by the slope of the trend line. A hyperbolic tangent function is used to normalize values and reduce distortion from outliers.

The final score is capped between -10 and +10, and used to define the trend state:
  • Green when the trend is bullish (score > +1.5)
  • Red when the trend is bearish (score < -1.5)
  • Brown when the trend is neutral (score between -1.5 and +1.5)


Optional Deviation Bands can be displayed at ±1, ±2 and ±3 ATR distances around the central line. These dynamic zones help identify extended price movements or potential support and resistance areas, depending on the current trend bias.

Main features:
  • A single, stable trend line based on six timeframes
  • Automatic rebalancing depending on trading mode
  • Quantified score integrating distance and slope
  • No overreaction to short-term noise
  • Deviation zones for advanced market context
  • No repainting, no lookahead, 100% real-time


SMEMA Trend Core is not a signal tool. It is a directional framework that helps you stay aligned with the real structure of the market. Use it to confirm setups, filter trades or simply understand where the market stands in its trend cycle.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.