OPEN-SOURCE SCRIPT

EWMAC Trend Signals [QuantAlgo]

5 486
🟢 Overview

The EWMAC Trend Signals is a trend-following indicator built on exponentially weighted moving average crossovers (EWMAC), a staple trend rule in systematic futures trading. In that setting, the rule typically runs across many markets at several speeds at once. Each reading is divided by volatility, so a trend's strength, not just its direction, sets how much exposure to take. That design is why it anchors this indicator: fast speeds respond to new trends sooner, slow speeds stay with longer ones, and volatility scaling keeps readings comparable from quiet stock indices to volatile crypto. Up to six EWMAC speeds blend into one trend score that drives bullish, bearish, and neutral signals through a hysteresis band, so traders can follow established trends through shallow pullbacks on any asset and any interval.
스냅샷
🟢 How It Works

Each EWMAC rule compares a fast EMA with a slow EMA spanning four times as many bars, so the gap between them widens as a trend develops and narrows as it fades. To give that gap the same meaning on any market, it is divided by a volatility unit built from the standard deviation of log returns, blended with a share of its long-run average. The result is rescaled to target an average absolute score of 10, either adaptively from the rule's own recent history or from a fixed factor based on its span. It is then capped to limit how far any single speed can pull the blend:
Pine Script®

Up to six rules run at geometrically spaced speeds, from 2/8 through 64/256 bars by default, and their scores are combined by weight into a single trend score. Averaging partially correlated rules shrinks the result, so a diversification multiplier restores the scale based on how many rules are active, or a manual value. The same weights average each rule's EMA midpoint into the trend line plotted on price:
Pine Script®

The trend score then drives the signals. A bullish signal confirms when the score rises above the entry threshold, and a bearish signal confirms when it falls below the negative threshold. The exit level sits at a fraction of the entry threshold, forming a hysteresis band. With the neutral state enabled, a signal holds while trend strength eases and releases to neutral only once the score fades back through that level:
Pine Script®

스냅샷
🟢 Signal Interpretation

▶ Bullish Trend (Green/Bullish palette): When the trend score rises above the entry threshold on a confirmed bar, the indicator enters bullish mode. Bullish coloring applies across the trend line, neon glow, signal readout, price bars, and optional background. The signal holds while the score stays above the exit level, so pullbacks that only ease trend strength pass without releasing it. With the neutral state disabled, it holds until a bearish signal confirms. Trend traders can read the turn into bullish as a long bias or continuation cue, with the trend line as a dynamic reference for the prevailing trend.

▶ Bearish Trend (Red/Bearish palette): When the trend score falls below the negative entry threshold on a confirmed bar, the indicator enters bearish mode with bearish coloring across all visual elements. The signal holds while the score stays below the negative exit level. With the neutral state disabled, it holds until a bullish signal confirms. Trend traders can read the turn into bearish as a short bias or a cue to exit long exposure.

▶ Neutral (Gray/Neutral palette): With Use Neutral State enabled, a bullish or bearish signal releases to neutral once the trend score fades back through the exit level. This marks a trend that has lost strength without a confirmed reversal. Neutral also covers the warm-up period before the first signal confirms. Trend traders can use neutral phases to stand aside or manage open positions until the score commits to a direction again.
스냅샷
🟢 Features

▶ Preconfigured Presets: Three parameter sets cover different trading approaches. "Default" uses the manual settings, starting with Rules 2 to 5 active and a moderate entry threshold for swing trading on 4-hour and daily charts. "Fast Response" activates Rules 1 to 4, shortens the volatility and scaling windows, lowers the entry threshold, and narrows the hysteresis band. It suits intraday charts from 5-minute to 1-hour, where earlier signals matter more than fewer flips. "Smooth Trend" activates Rules 4 to 6, lengthens the volatility and scaling windows, raises the entry threshold, and widens the hysteresis band. It suits position trading on daily and weekly timeframes, where false signals are more costly than delayed ones. Selecting a preset overrides the active rules along with the corresponding volatility, scaling, and signal inputs.
스냅샷
▶ Built-in Alerts: Four alert conditions cover every signal change. "Bullish Trend Signal" fires on the confirmed bar where the signal turns bullish. "Bearish Trend Signal" fires on the confirmed bar where it turns bearish. "Neutral Trend Signal" fires when a bullish or bearish signal releases to neutral. "Trend Signal Changed" combines all three into a single condition for traders who want one notification for any change. Alerts continue to work even when the signal readout is hidden.
스냅샷
▶ Visual Customization: Six color presets (Classic, Aqua, Cosmic, Cyber, Neon, and Custom) apply coordinated bullish and bearish color schemes across the trend line, neon glow, signal readout, and bar and background coloring. Custom also lets you set the neutral color. The trend line offers an adjustable width and an optional neon glow effect. The signal readout labels the active signal as Bullish, Bearish, or Neutral at the end of the trend line in a selectable text size. Bar coloring tints price candles with the active signal color at a configurable transparency level, and background coloring extends that tint across the full chart pane.
스냅샷

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.