PROTECTED SOURCE SCRIPT

Neutral Entry Monitor — 1S Primary SR (Protected, Pine v6)

25
[Short description]

Detects *New Neutral* states from a 1‑second consensus Primary, stores deduped S/R levels, shows nearest levels with mini‑tags, and tracks first‑touch stats. Protected to safeguard unique consensus/neutral logic; free to use, source code not public.

[What this indicator does]
- Neutral detection (1S Primary): Tracks a consensus of box sizes to form a Primary (price vs. close). A *New Neutral* occurs when the Primary‑Price and Primary‑Close converge within a configurable tolerance.
- S/R level storage with dedup: Each New Neutral locks an S/R level; nearby duplicates are filtered by tolerance to avoid clutter.
- Nearest S/R & mini‑tags: Shows the nearest Resistance (above) and Support (below) relative to the live 1‑second price; optional mini‑tags include level and distance in ticks.
- First‑touch experiment: After a New Neutral, it records which side (R or S) is touched first (with a buffer), tallying UP/DN/TIE counts for validation.
- Non‑repainting design: Uses `request.security()` with `lookahead=barmerge.lookahead_off`. No future data is accessed. Real‑time values can update within the current bar, which is expected behavior for live data.

[How it works (concepts)]
1) Consensus Primary: Builds a list of box sizes (in ticks), tracks both 1S price and bar close; the last index is the **Primary**.
2) New Neutral: When `|PrimaryPrice − PrimaryClose| ≤ tol` and a state transition occurs, the script records a level.
3) Nearest search: Efficient scans find nearest **above** (R) / **below** (S) levels; optional mini‑tags show distance in ticks.
4) First‑touch logic: After a New Neutral, the script waits up to *N bars* for a buffered touch of R or S and updates UP/DN/TIE stats.

[Inputs]
- Largest box (ticks), Step for box list (ticks): define the consensus box set.
- Equality tolerance × minTick: Neutral equality tolerance.
- Max neutral levels stored: ring buffer size.
- Nearness threshold (ticks): when to show mini‑tags.
- Visibility toggles: Primary lines, New Neutral dot, SR drawing, mini‑tags.
- Turn‑Test: *Max bars to decide*, *Confirm buffer (ticks)*.

[Notes on use & limitations]
- Clean chart when publishing: Show only this indicator unless strictly required; ensure outputs are clearly visible.
- No unrealistic claims: This is a market‑structure utility; it does not guarantee direction or results. Avoid performance/accuracy claims.
- Data availability: 1S data depends on the symbol/data source; where unavailable, it falls back to chart’s timeframe close for stability.
- Live‑bar updates: Mini‑tags and distances update tick‑by‑tick during the current bar; historical bars remain stable.

[Alerts]
- Included: New Neutral — fires when a new neutral state is detected by the 1S Primary consensus.
- Suggested English text: “Fires when a New Neutral is detected by the 1S Primary consensus.”

[Release Notes]
**v1.0.0**
- Initial public release (Protected).
- Consensus‑based New Neutral detection, deduped SR storage.
- Nearest R/S mini‑tags with tick distances.
- First‑touch statistics after New Neutral.
- No lookahead; live‑bar updates expected.

[Risk / Disclaimer]
This tool is provided for educational purposes. It does not provide financial advice or guaranteed results. Markets are uncertain; past behavior does not guarantee future outcomes.

[Code Header Comment]
pine
//version=6
// Neutral Entry Monitor — 1S Primary SR (Protected, Pine v6)
// Description : Detects New Neutral from a consensus‑based 1S Primary, stores deduped SR, shows nearest S/R mini‑tags, and tracks first‑touch stats. No lookahead; live‑bar updates may occur.
// Notes: Educational use only. No financial advice. Source is hidden (Protected publish).

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。