OPEN-SOURCE SCRIPT

Money Flow Regime [forexobroker]

367
Money Flow Regime [forexobroker] reads the Chaikin-style accumulation/distribution flow of an instrument, z-normalises it over a rolling window, and sorts that reading into five symmetric regime bands (strong-in, mild-in, neutral, mild-out, strong-out). The active band sets a directional bias and a reclaim-EMA cross times the actual entry, so you act with the dominant money-flow rather than against it. The symmetric banding means the read and the rules are identical long or short.

🔶 ALGORITHM

1. Build a money-flow multiplier per bar: ((close - low) - (high - close)) / (high - low), times volume, accumulated into a running Accumulation/Distribution line.
2. Compute a Chaikin-style oscillator as the spread of a fast EMA minus a slow EMA of the A/D line.
3. Z-normalise that oscillator over the Normalise Window using its rolling mean and standard deviation to get a flow z-score.
4. Sort the z-score into bands: |z| >= Strong Band Z is a strong regime, |z| >= Mild Band Z is a mild regime, otherwise neutral. Sign of z sets the bias (inflow bullish, outflow bearish).
5. Once a tradable band sets the bias, a close-cross of the Entry Reclaim EMA in the bias direction times the entry. ATR is tracked for context.

🔶 SIGNAL LOGIC

- Buy: in-session AND regime is tradable AND flow bias is bullish AND close crosses over the reclaim EMA AND not already long AND cooldown elapsed AND barstate.isconfirmed (position-locked).
- Sell: in-session AND regime is tradable AND flow bias is bearish AND close crosses under the reclaim EMA AND not already short AND cooldown elapsed AND barstate.isconfirmed (position-locked).
Only fires when the flow band is tradable (mild-or-strong, or strong-only if Require Strong Band is on).

🔶 INPUTS

- Money Flow: Chaikin fast/slow EMA lengths, normalise window, and the band z thresholds; key default Chaikin Fast EMA = 3.
- Money Flow: Mild and Strong band z levels separate neutral, mild and strong regimes; default Strong Band Z = 1.0.
- Money Flow: ATR length for volatility context; default ATR Length = 14.
- Signal Logic: Entry Reclaim EMA that times the entry inside the bias; default Entry Reclaim EMA = 9.
- Signal Logic: Require Strong Band restricts trading to the strong regime only; default off.
- Signal Logic: Cooldown bars between signals; default Cooldown Bars = 5.
- Filters: optional session restriction with a session window; default Restrict to Session off.
- Visual: dashboard, 3-layer glow, reclaim-EMA plot, and buy/sell/background colors; dashboard default on.

🔶 ALERTS

MFR Buy, MFR Sell, MFR Any Signal, MFR Strong In, MFR Strong Out, MFR Bias Bull, MFR Bias Bear, MFR EMA Up, MFR EMA Down, MFR Flow Zero, MFR Band Change, MFR Armed, MFR Webhook JSON.

🔶 LIMITATIONS

- Requires a real volume feed; on instruments with synthetic or missing volume the flow reading is unreliable.
- Needs warm-up bars for the A/D EMAs and the normalise window before bands stabilise.
- Z-band defaults are tuned for liquid instruments; thin markets may need wider thresholds.
- The reclaim EMA introduces deliberate entry lag versus the raw band change, by design.
- Regime bands describe flow context, not a forecast; chop can flip bias repeatedly.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.