PROTECTED SOURCE SCRIPT

QuantTrader MTF Momentum — QUIET v6 (TG + preset fix)

23
QuantTrader MTF Momentum — QUIET (TG + Presets)
What it is

A discretionary, multi-filter entry framework that fires BUY/SELL signals only when:

trend aligns on your chart + optional HTF EMA slope,

momentum agrees (RSI / MACD / Stoch), and

market quality is acceptable (ATR regime, ADX, choppiness, candle body vs ATR), with an optional Donchian breakout gate.

It can also push Telegram messages using TradingView’s Webhook alerts and draws an ATR-based stop & 1R/1.5R/2R targets.

Core building blocks
1) Trend & HTF confirm

Baseline: EMA (default), HMA, or Supertrend (line closest to price).

HTF EMA slope (optional): fetches a higher-timeframe EMA, requires small positive slope & price above EMA for longs (negative & below for shorts).

2) Momentum score (0–3)

RSI: above buy level & rising (3-bar) for longs; below sell level & falling for shorts.

MACD: line crosses signal + histogram sign agrees.

Stoch: %K cross %D from OB/OS zones.

You set Min Momentum Signals (default 2). QUIET mode uses this as a hard gate.

3) Market quality / noise guards

ATR regime: current ATR must sit within a band around median ATR.

ADX threshold (via DMI).

Choppiness must be <= max.

Body vs ATR: minimum candle body to avoid tiny/noise bars.

4) Breakout filter (optional)

Donchian “close > prior Donchian High” for longs (or < Low for shorts).

5) Sessions (optional)

Only allow trades inside enabled sessions (Asian / London / NY). Session shading is included.

Presets (baked in)

Use Use Preset Profile = ON and pick a profile. These nudge thresholds so the engine feels “right” for the underlying:

FX Strict

ATR min/max ~ 0.90 / 2.00, ADX ≥ 28, Choppiness ≤ 50, Min Body 0.60 ATR, Min Momentum = 3.

Objective: cleaner, fewer FX entries.

Gold Balanced

ATR min/max ~ 0.90 / 2.00, ADX ≥ 26, Choppiness ≤ 52, Min Body 0.55 ATR, Min Momentum = 2.

Objective: slightly looser than FX for XAU’s volatility.

BTC Momentum

RSI buy/sell 58/42, ATR min/max ~ 0.80 / 2.40, ADX ≥ 22, Choppiness ≤ 58, Min Body 0.45 ATR, Donchian disabled by default, Min Momentum = 2.

Objective: accommodate crypto’s fast momentum bursts.

You can still override any input if you want a custom mix (turn presets off to use your exact values).

Quiet vs. Loose mode

Quiet Mode ON (default):
BUY = Session OK ∧ Trend OK (UP) ∧ Momentum ≥ Min ∧ ATR/ADX/Chop/Body OK ∧ (Donchian if enabled).
SELL is mirrored.

Quiet Mode OFF (more entries):
BUY = Session OK ∧ Trend OK (UP) ∧ Momentum ≥ 1 ∧ ATR regime OK.
(Skips ADX/Chop/Body & Donchian gates.)

Signals & overlays

plotshape BUY/SELL on chart (bar close).

ATR stop & targets: plots Stop, 1R / 1.5R / 2R lines on entry bar.

Internal state tracks TP1/TP2/TP3/STOP “hits” on later bars.

Alerts & Telegram

Create a single TradingView alert on this indicator, Condition = “Any alert() function call”.

Paste your Telegram Bot API webhook URL in the TV alert’s Webhook field.

In the script, enable Telegram and set chat_id.

The code builds JSON payloads for:

BUY/SELL on signal bars

TP1/TP2/TP3/STOP hits after entry
Messages include preset, mode (Q/L), momentum score & session.

Note: TV sends the payload; your external bridge (or a simple webhook proxy) must forward to Telegram’s sendMessage API.

How to use (practical)

Pick your symbol/timeframe. For intraday FX start with 5–15m.

Turn Use Preset Profile ON and select FX Strict / Gold Balanced / BTC Momentum depending on the instrument.

Keep Quiet Mode ON for cleaner trades.

Trade only when BUY/SELL fires at bar close.

Use the risk overlay stop/targets to plan exits (or let the alert messages confirm TP/STOP).

Avoid flat or over-choppy sessions (you’ll see guards blocking entries).

Consider HTF confirmation to line up with the 30m/60m trend.

Notes & limits

It’s an entry filter, not a full system—add your own position sizing & management rules.

Past performance on one asset/timeframe doesn’t guarantee results on another—use the presets as a starting point, then adjust RSI/ADX/ATR bands to the instrument’s personality.

Signals are bar-close to reduce repaint-style inconsistencies.

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.