OPEN-SOURCE SCRIPT

Chart Setup [Ribbon + WT Crossover + Flow]

230
TITLE
Ribbon + WaveTrend Crossover + Money Flow [All-in-One Confluence]

SHORT TAGLINE (for the summary field)
Trend ribbon, WaveTrend/RSI crossover engine, and money-flow confirmation unified in a single indicator — with a three-layer confluence signal, multi-symbol screener table, and full alert suite.

─────────────────────────────────────────────
FULL DESCRIPTION (paste into the publication page)
─────────────────────────────────────────────

█ OVERVIEW

This indicator merges three complementary layers of market analysis into one script, so a complete trend-following workflow loads with a single "Add to chart":

• PRICE LAYER — a two-EMA ribbon cloud that defines trend regime, a slow dotted baseline for macro bias, and "Long / Short Initiated" labels printed at ribbon flips.
• MOMENTUM LAYER — a selectable oscillator engine in its own pane: WaveTrend (default) or RSI + Signal. Blue vs red crossover lines with a shaded green/red regime background.
• VOLUME-FLOW LAYER — a Money Flow wave, normalized and drawn as a compact strip along the bottom of the pane, with "V" flags when flow confirms a fresh bullish impulse.

The script uses Pine's force_overlay capability so the ribbon, labels, and candle coloring render on the price chart while the oscillator and flow strip live in the indicator's own pane — one script, two visual domains.

█ WHY THESE THREE TOGETHER (mashup rationale)

Each layer answers a different question, and each has a known weakness that the others cover:

• The EMA ribbon defines direction but lags and whipsaws in chop.
• The oscillator crossover times entries earlier but fires false signals against the trend.
• Money flow validates whether volume actually supports the move.

The value of the mashup is the CONFLUENCE signal: a diamond prints (and an alert fires) only when all three agree simultaneously — ribbon flips bullish, oscillator line 1 is above line 2, and money flow is positive (mirrored logic for shorts). Individually these are common tools; combined gating is the point of this script.

█ HOW IT WORKS

Ribbon Cloud
Fast EMA (default 20) vs Slow EMA (default 50). The area between them is filled teal when fast > slow, pink when fast < slow. A slow SMA baseline (default 200) is drawn as a dotted line for higher-order bias. Labels print on crossovers of the two EMAs.

Oscillator Engine (selectable)
• WaveTrend mode (default): esa = EMA(hlc3, n1); ci = (hlc3 − esa) / (0.015 × EMA(|hlc3 − esa|, n1)); WT1 = EMA(ci, n2); WT2 = SMA(WT1, 4). Zero midline, configurable overbought/oversold levels (default ±60). WaveTrend concept credit: LazyBear.
• RSI + Signal mode: RSI (default 14) vs its EMA signal line (default 9), with 30/50/70 levels.
The pane background shades green while line 1 > line 2 and red otherwise, making regime changes readable at a glance.

Money Flow Strip
SMA(((close − open) / (high − low)) × multiplier, period), z-score normalized, clamped, and rescaled into a fixed band at the bottom of the pane (the band position auto-adapts to the active engine's scale). A "V" flag prints a configurable number of bars after flow crosses above zero while it remains positive.

Screener Table (optional, off by default)
A compact table on the price chart tracks up to five user-selected symbols on the chart timeframe, showing each symbol's ribbon regime (BULLISH / BEARISH) and the time of its most recent flip. Uses request.security without lookahead.

█ SIGNALS & ALERTS

• Ribbon Long / Ribbon Short — EMA ribbon flip
• Osc Bull Cross / Osc Bear Cross — oscillator line crossover
• Money Flow Bull — flow crosses above zero
• CONFLUENCE LONG / CONFLUENCE SHORT — all three layers aligned (diamond markers on chart)

All are standard alertcondition() alerts and work with webhooks.

█ INPUTS

Every parameter is exposed: ribbon lengths and source, engine selection, WaveTrend channel/average/signal lengths and OB/OS levels, RSI/signal lengths, background transparency, money-flow period/multiplier/flag delay, screener symbols and toggle, and every color used by the script.

█ HOW TO USE

1. Keep the default WaveTrend engine on intraday timeframes (15m shown in the chart example); switch to RSI + Signal if you prefer a bounded 0–100 oscillator.
2. Treat the ribbon as the regime filter: only take oscillator signals in the direction of the cloud color.
3. Use the confluence diamonds as the highest-conviction trigger, and the money-flow "V" flag as an add-on/continuation confirmation.
4. Tune the fast/slow EMA pair to your instrument's rhythm (13/48, 20/50, and 21/55 are common intraday pairs).

█ NOTES & LIMITATIONS

• Signals are evaluated on bar close; the regime background and cloud color on the live bar can change until the bar closes.
• The screener table reads the chart's timeframe for all symbols and is limited to five symbols to stay within request.security limits.
• hline() accepts constants only, so the engine-dependent mid/OB/OS levels are drawn as dotted plot() lines.
• This is a trend-following toolkit: expect whipsaws in low-volatility congestion; the confluence gate reduces but does not eliminate them.

█ CREDITS

WaveTrend oscillator concept: LazyBear (WaveTrend Oscillator [WT]).
Money-flow wave construction is inspired by the money-flow component popularized in Market Cipher-style tools.
Ribbon cloud, engine unification, normalization/band placement, confluence gating, screener table, and all code in this script are original work.

█ DISCLAIMER

This script is for educational purposes only and is not financial advice. Trading futures and options involves substantial risk of loss. Always do your own research and test any tool on historical data and paper trades before using it with real capital.

─────────────────────────────────────────────
SUGGESTED TAGS
trend, wavetrend, rsi, moneyflow, ema, ribbon, crossover, confluence, screener, intraday

CHART TO PUBLISH WITH
Use a clean 15m chart of a liquid NSE F&O stock showing one clear ribbon flip with a confluence diamond, oscillator crossover, and money-flow flag visible — TradingView requires the published chart to clearly demonstrate the script's output with no unrelated drawings or other indicators.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.