PROTECTED SOURCE SCRIPT
Atualizado

[NBK] Cover Buy Sell

64
[NBK] Cover Buy Sell — Engulfing Reversals with EMA/ATR Trend & Quality Filters

What it does
This indicator flags high-quality bullish/bearish reversal candles only when they align with a short-term trend and pass several objective quality filters. It is not a simple mashup: each component serves a distinct role and they work together to keep early/low-quality signals out.

How it works (components & interaction)

Pattern engine (entry candidates)

Bullish side (Cover Buy):

Body Engulf: current green body fully covers the prior red body, or

Piercing (relaxed): prior red → current green closes above the prior body’s midpoint (not beyond prior open).

Bearish side (Cover Sell):

Full-candle Engulf: current red candle (body + wicks) covers the entire prior candle, or

Body Engulf: current red body fully covers the prior body, or

Dark-Cloud (relaxed): prior green → current red closes below the prior body’s midpoint.

Short-term trend gate (non-repainting)

Trend is defined by the EMA slope between bar-1 and bar-2, scaled by ATR to require minimum strength.

Slope < 0 → only bullish candidates pass. Slope > 0 → only bearish candidates pass.

Body-size filter (noise control)

Rejects tiny candles: each body is compared with the lookback average body size.

For bearish candidates an additional ratio check requires current body ≥ a fraction of the prior body (to avoid weak top-ticks).

Peak filters for bearish signals (late, cleaner tops)

Distance above EMA: the high must be at least X × ATR above EMA (avoids mid-range noise).

Near local high: the high of the current bar (or bar-1) must be close to the highest high in a recent window.

Break confirmation: close must break low[1] by at least Y × ATR (filters shallow dark-clouds).

Only when a candidate satisfies the pattern ➝ trend ➝ size ➝ peak sequence is a signal printed/alerted.

Inputs (key parameters)

EMA length, Min EMA slope vs ATR, ATR length: trend strength.

Lookback for average body, Min body vs average, Bear body ratio: body-quality filters.

High distance above EMA (×ATR), Local high lookback, Tolerance to local high (×ATR), Min break of low[1] (×ATR): bearish peak confirmation.

Alerts
Built-in alerts fire on bar close for both Cover Buy and Cover Sell.

How to use

Increase High distance above EMA / Local high lookback / Min break of low[1] to reduce early Cover Sell in ranges.

If you miss good tops, ease those thresholds slightly.

Works across symbols/timeframes; evaluated on bar close; no repaint from the trend gate.

Notes
This tool is a signal screener, not financial advice. For best results, combine with your structure/SR zones, risk management, and execution rules.
Notas de Lançamento
[NBK] Cover Buy Sell — Engulfing Reversals with EMA/ATR Trend & Quality/Peak Filters

What this script does
Flags high-quality bullish/bearish engulfing reversals only when short-term trend and price-action quality conditions are met. Signals evaluate on bar close. No promotions, no links, no external calls.

Why this is an original combination (mashup justification)
Raw engulfing patterns are noisy in ranges. This script is a pipeline where each module solves a specific failure mode, not a simple merge of indicators:

Pattern engine (candidates):

Bullish (Cover Buy): body-engulf of prior red body, or relaxed Piercing (close above prior body midpoint, not beyond prior open).

Bearish (Cover Sell): full-candle engulf (body+wicks), body-engulf, or relaxed Dark-Cloud (close below prior body midpoint).

Short-term trend gate (non-repainting):
EMA slope is measured between bar-1 and bar-2 and must exceed an ATR-scaled threshold (slopeAtrPct).

Slope < 0 → only bullish candidates pass.

Slope > 0 → only bearish candidates pass.

Body-size filter (noise control):
Bodies must not be tiny vs the average over lenBodyRef. For bearish candidates, an alternate check allows current body ≥ bearRatioMin × prior body to keep decisive tops.

Bearish peak filters (late, cleaner tops):
High must be far above EMA (≥ emaDistAtrMin × ATR), near the local high (current or prior bar within nearHighLen & nearHighTol × ATR), and the close must break prior low by ≥ breakAtrMin × ATR.
These remove premature Cover Sell flags in chop and keep the later, higher-quality reversal.

Only candidates that pass Pattern → Trend → Size → Peak become signals. This staged design is the core originality.

How to use (practical guidance)

To reduce early Cover Sell in ranges: raise emaDistAtrMin, raise nearHighLen, and/or raise breakAtrMin.

If you miss clean tops: slightly lower those thresholds.

Typical starting points: lenTrend=4–6, slopeAtrPct=0.03–0.06, atrLen=14; adjust to instrument/TF volatility.

Combine with structure/SR zones and your risk rules. This tool is for analysis only and is not investment advice.

Alerts
Two alert conditions are included: Cover Buy and Cover Sell, both evaluated on bar close.

Non-repainting note
The trend gate uses confirmed data (EMA slope from bar-1 vs bar-2). Pattern and filters also use confirmed values; no forward-looking references.

English translations of UI strings (if your on-chart UI uses another language)

“Strict engulf (không cho bằng nhau)” → Strict engulf (no equality)

“EMA length (trend ngắn hạn)” → EMA length (short-term trend)

“Lookback tính thân trung bình” → Lookback for average body size

“Ngưỡng thân tối thiểu vs trung bình” → Min body vs average (ratio)

“Bear: thân hiện tại ≥ rRatio * thân trước” → Bear: current body ≥ rRatio × prior body

“Bear: HIGH cách EMA tối thiểu (x ATR)” → Bear: HIGH distance above EMA (× ATR) min

“Bear: cửa sổ đỉnh cục bộ (bars)” → Bear: local high lookback (bars)

“Bear: dung sai tới đỉnh (x ATR)” → Bear: tolerance to local high (× ATR)

“Bear: mức phá LOW[1] tối thiểu (x ATR)” → Bear: min break of LOW[1] (× ATR)

Compliance notes

English-only title, English appears first in this description; no ads, logos, links, or solicitations.

This is an original, closed-source script with a meaningful explanation of what, how, why, and how to use.

(Vietnamese short summary)

Chỉ báo bắt tín hiệu engulfing chất lượng cao khi có xu hướng EMA ngắn hạn (đo bằng độ dốc/ATR) và vượt qua lọc kích thước thân + điều kiện đỉnh cho tín hiệu bán. Chuỗi xử lý Mẫu → Xu hướng → Kích thước → Đỉnh giúp loại tín hiệu sớm trong vùng đi ngang. Có alert Cover Buy/Sell, đánh giá theo bar close, không quảng cáo/đường link, và không phải khuyến nghị đầu tư.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.