OPEN-SOURCE SCRIPT

Viprasol Liquidity Trail Matrix with Signal Target

5 328
Overview

The Viprasol Liquidity Trail Matrix with Signal Target is a trend-following signal engine that combines a volatility-adaptive trailing "liquidity" band structure with a Cardwell-style RSI regime filter, then turns confirmed pullback-and-continuation events into fully managed trade plans — entry, stop, three scaled targets, break-even logic, and an honest performance read-out. It is built for discretionary traders who want a single tool that answers three questions at once: what is the trend, is momentum backing it, and if a signal fires, exactly where are my entry, stop and targets.

This is an open-source, credited derivative. See the Credits & Originality section at the end — the trailing-matrix and Cardwell-RSI concepts are adapted from prior open-source work under CC BY-NC, with substantial original additions layered on top.

How It Works

Step 1 — Liquidity Trail Matrix (adapted)

A volatility trailing stop (ATR-scaled) defines the active trend and flips only when price closes decisively through it. Around that trailing line the script projects a ladder of "liquidity bands" spaced in ATR units, forming the retest zone price tends to revisit before continuation. In an uptrend the bands sit below price as stacked support; in a downtrend, above price as resistance. Because the spacing is ATR-based, the whole structure widens in volatile conditions and tightens in quiet ones.

Step 2 — Cardwell RSI Regime (adapted)

RSI is classified into a directional regime using Andrew Cardwell's range-rules principle: in a healthy uptrend RSI holds its 40-80 band, in a downtrend it works the 20-60 band. The regime flips bull when RSI thrusts through the upper trigger and bear when it breaks the lower trigger, holding state in between. Signals are only allowed in agreement with the regime, so the momentum context must confirm the trend before anything fires.

Step 3 — Confluence gating (adapted + new)

Before a signal is eligible it must pass a confluence gate: trend agreement, RSI regime agreement, an ADX minimum (chop filter), and an optional higher-timeframe bias pulled non-repainting (previous HTF bar, lookahead off). A minimum confluence score suppresses low-quality setups.

Step 4 — Retest entry + Signal Target (adapted)

When the confluence conditions hold and price pulls back into the band zone then closes back in the trend direction, a signal fires on the confirmed bar. The engine sets a structural stop, then projects TP1/TP2/TP3 as R-multiples of that risk and draws them on the chart with price and percent labels. Break-even logic moves the stop to entry after TP1.

Step 5 — Honest trade management + statistics (new)

Original additions in this release:

- One-trade-at-a-time engine: a trend flip no longer force-closes a trade. A position runs to its stop or final target, and a new entry only opens once the previous one is fully resolved. A reversal toggle restores the old flip-reversal behaviour if preferred.
- Max-bars-in-trade timeout so a lingering position cannot block the engine indefinitely.
- Hide-on-hit targets: each target line and label is removed the instant it is touched, keeping the chart clean.
- Staggered target labels so ENTRY/SL/TP1/TP2/TP3 never overlap.
- Session filter and post-stop cooldown (both optional, off by default).
- Honest performance panel: Avg R and Profit Factor computed on a transparent one-third-scale-out model, plus Max Drawdown in R and best/worst streak — so the win-rate (which counts a trade a win once TP1 is touched) is read alongside true expectancy.
- Suggested position size from an account-size and risk-percent input.

Non-repainting: trend, structure, signals and targets confirm at bar close; higher-timeframe data uses lookahead off on the previous bar.

Key Features

- Volatility-adaptive trailing liquidity-band matrix
- Cardwell RSI regime filter
- ADX chop filter + optional non-repainting HTF bias
- Range-distributed volume profile (POC / Value Area / low-volume nodes)
- Retest-continuation signals with confluence scoring
- Entry / SL / TP1-TP2-TP3 with R-multiple targets, break-even and hide-on-hit visuals
- One-trade-at-a-time management with optional reversal, timeout, session filter and post-stop cooldown
- Honest stats: win rate, Avg R, Profit Factor, Max Drawdown (R), streak, suggested size
- Multi-section dashboard, trend-tint candles, and a full alert suite with optional webhook JSON

How to Use

1. Add to any liquid symbol and timeframe. Confirm the dashboard reads a clear trend and RSI regime.
2. Wait for a LONG/SHORT marker — it only fires on a confirmed retest that passed the confluence gate. The number on the marker is the confluence score.
3. Trade the drawn plan: entry, stop, and TP1/TP2/TP3. The dashboard mirrors the live levels and, once trades close, shows Avg R / Profit Factor / Max DD so you can judge the edge honestly.
4. Tune selectivity with ADX Minimum and Min Score; tune trade behaviour with the reversal, timeout, session and cooldown settings.

Settings

- Trend Engine: ATR length, trail factor, band count and spacing
- Signals: min score, retest window, cooldown, integration mode, reversal toggle, session filter, post-SL cooldown
- RSI Regime: length, bull/bear triggers, confirm bars, integration mode
- Risk Management: SL mode, break-even, max bars in trade, account size, risk %
- Signal Targets: R-multiples for TP1/TP2/TP3
- Volume Profile / HTF / Dashboard / Colors: display and behaviour toggles, all with tooltips

Alerts

Dynamic alerts (ticker, timeframe, price, score, levels, RSI, regime) for: Long entry, Short entry, TP1/TP2/TP3 hit, break-even, stop-out, reversal, trend flips, and regime shift. Entry alerts can emit webhook-ready JSON.

Limitations & Disclaimer

This is an analysis and trade-planning tool, not a promise of profit. The built-in statistics are a session-level model (they reset on chart reload), assume idealised fills with no slippage or commission, and use a one-third-scale-out assumption for Avg R — real results differ. Signals confirm at bar close and do not repaint historically, but the still-forming bar is provisional until it closes. No indicator predicts the future; always combine with your own risk management. Nothing here is financial advice.

Credits & Originality (CC BY-NC 4.0)

This script adapts and builds upon prior open-source work and is published open-source, free, for non-commercial use, with attribution as required by the licence:

- "Liquidity Trail Matrix" by WillyAlgoTrader — the trailing liquidity-band structure concept.
- "Cardwell Range Analyze" by MarkitTick — the Cardwell RSI range-regime concept.

Changes made by Viprasol (this version): combined the two engines into one workflow and added the confluence gate, non-repainting HTF bias, range-distributed volume profile, R-multiple Signal Targets with break-even and hide-on-hit visuals, one-trade-at-a-time management with reversal toggle / max-bars timeout / session filter / post-stop cooldown, the honest statistics panel (Avg R, Profit Factor, Max Drawdown R, streak) and suggested position size, plus the multi-section dashboard and dynamic/webhook alerts.

Licence: Creative Commons Attribution-NonCommercial 4.0 (creativecommons.org/licenses/by-nc/4.0/). Educational, non-commercial use only. Not financial advice.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน