Trend Signals [QuantAlgo + Quantum & Fractal Engine]

521
1. EWMAC Rules
There are 6 rules, each using a fast and slow moving average (MA) pair:

Fast MA — Rule Length;

Slow MA — Fast × Slow/Fast Multiplier (default: 4);

Each rule can be enabled/disabled and its weight can be set;

A weight of 0 excludes the rule from the score and trend line.

Rules 2–5 are enabled by default, rules 1 and 6 are disabled.

2. MA Engine
Many smoothing algorithms are supported:

EMA, SMA, WMA, RMA, HMA, LSMA, VWMA, ALMA, DEMA, TEMA, ZLSMA, McGinley, UltimateSmoother, T3, Jurik, Kalman2State, ZLEMA, KAMA, QASE, Kalman, Gaussian Fractal / FRAMA, TRAMA Classic, TRAMA Modern, RLS2, LaguerreF.

Some engines have separate parameters: sensitivity, boost, α ceiling, β multiplier, KAMA, FRAMA, Laguerre, ALMA, McGinley, T3, Jurik, Kalman2State, etc.

3. Score Modes
The raw score of each rule can be calculated in three ways:

Fast - Slow (classic) — the difference between the fast and slow moving averages. This is the classic EWMAC. It works better with lagging moving averages: EMA, SMA, WMA, RMA, Kalman, LaguerreF without a prefilter, etc.

Fast slope — the change in the fast moving average over the slope window. Suitable for low-lag moving averages: ZLEMA, QASE, RLS2, HMA, DEMA, TEMA, etc.

Price deviation from fast — the distance from the price to the fast moving average. Like the classic mode, it requires lagging moving averages.

4. Volatility
The volatility score is calculated using logarithmic returns:

short-term window stdev;

long-term average;

mixing short-term and long-term volatility with a specified weight;

then volatility is converted into a risk price unit.

This is necessary to ensure that the score is comparable across instruments and volatility modes.

5. Score Scaling
There are two modes:

Adaptive – the scale is adjusted based on the recent history of each rule;

Fixed – the scale is based on the length of the fast moving average.

The target average |score| is set separately. There is also a score limit – Score Cap.

6. Rule Aggregation
Active rules are summed with weights. A diversification multiplier is additionally applied:

0 – automatic based on the number of active rules;

greater than 0 – manual value.

The final trendScore is limited by Score Cap.

Signal Logic
There is an Entry Threshold and an Exit Fraction.

If trendScore > entryTh, a bullish signal is triggered.

If trendScore < -entryTh, a bearish signal is triggered.

If the neutral state is enabled, the signal resets to neutral when the score rolls back below entryTh × exitFrac for a bullish signal or above -entryTh × exitFrac for a bearish signal.

If the neutral state is disabled, the signal holds until the opposite entry threshold.

Signals are updated only on closed bars (barstate.isconfirmed), which reduces repainting.

HTF Filter
There is an optional higher timeframe filter:

is enabled separately;

HTF, MA algorithm, and length are specified;

the last closed HTF bar is used without lookahead repainting;

the filter blocks new signals against the HTF direction;

Works only if the HTF is strictly higher than the current timeframe.

Presets
There are three modes:

Default — all parameters are taken from the manual settings.

Fast Response — fast rules 1–4, entry 2.5, shorter volatility, adaptive scaling 150.

Smooth Trend — rules 4–6, entry 6.0, longer volatility, adaptive scaling 400.

Presets override: active rules, volatility period, long-term volatility weight and length, adaptive scaling length, entry threshold, and exit percentage. Rule lengths, weights, and engine parameters remain manual.

Visualization
The indicator draws:

the main trend line — a weighted average of the fast/slow moving average based on the active rules;

optional two-layer neon glow;

bar coloring;

background coloring;

Bullish/Bearish/Neutral status label for the last closed bar;

Trend Score value in the Data Window / status line.

Colors can be selected from the Custom, Classic, Aqua, Cosmic, Cyber, and Neon presets, or set manually.

Alerts
There is an alert condition for:

a bullish signal;

a bearish signal;

a neutral signal;

any signal change.

-In the classic Fast - Slow mode, low-lag MAs can give a score near zero during a trend—the "Fast Slope" mode is better for them.

-In the "Fast Slope" and "Price Deviation from Fast" modes, the Fixed Scale is not calibrated—Adaptive is recommended.

-The HTF filter lags by a maximum of one HTF bar because it only uses closed data.

Part of the idea was taken from QuantAlgo—thanks.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.