Omni Flow Consensus (LUXALGO) For ThinkOrSwim

NormalTrader888

New member
VIP
The author states:
The Omni-Flow Consensus [LuxAlgo] indicator is a high-performance momentum and liquidity oscillator designed to visualize the directional pressure behind price movements through volume-weighted aggression and adaptive smoothing. It provides a comprehensive view of market regimes, identifying high-conviction capital injections while filtering out low-probability market noise.
πŸ”Ά USAGE
The indicator is designed to be used as a primary trend-confirmation tool. Unlike standard oscillators that only track price, Omni-Flow incorporates volume and candle body relativity to determine if a move has "weight" behind it.
πŸ”Ή Momentum Regimes
  • Bullish Flow (Cyan): Occurs when the main flow line is above zero and expanding toward the upper bands. This indicates aggressive buying pressure.
  • Bearish Flow (Red): Occurs when the main flow line is below zero and expanding toward the lower bands. This indicates aggressive selling pressure.
  • Accumulation/Neutral (Gray): When the flow line stays within the "Zero Zone" (Β±10), the market is in a contraction phase. Users should exercise caution as this is often a "no-trade" zone.
πŸ”Ή Impulse Injections
The indicator plots small diamond shapes within the oscillator pane. These represent "Flow Injections"β€”moments where momentum has been confirmed by the Signal Strictness logic and has broken out of the neutral threshold. These are high-probability entry or trend-continuation points.

πŸ”Ή Gradient Candle Coloring
The script features a cinematic gradient coloring system for price bars. Instead of binary "Up/Down" colors, the candles transition smoothly between Bullish, Neutral, and Bearish states based on the flow intensity. This allows traders to visually "feel" the momentum fading or building before a crossover actually occurs.

πŸ”Ά HOW TO USE
Traders can utilize the Omni-Flow Consensus to filter entries and manage trend expectations:
  1. Trend Confirmation: Look for the main flow line to cross the Zero Axis. A cross above zero suggests a shift toward bullish dominance, while a cross below suggests bearish dominance.
  2. Identifying Injections: Pay attention to the Diamond symbols. These appear when the flow line crosses its signal line and maintains its direction for a set number of bars (defined by Strictness). These are often the start of volatile "expansion" phases.
  3. Volatility Monitoring: When the flow line remains flat near the zero line and the dashboard displays "ACCUMULATION," it indicates a lack of directional conviction. Traders may use this as a signal to avoid trend-following strategies until an injection occurs.
  4. Exhaustion Signals: When the flow line enters the glow bands (Β±70 to Β±90), the market is in an extreme state. While trends can persist here, a crossover of the signal line within these bands often precedes a mean reversion or deep pullback.


I use it for 5 minute time frame on NQ.

Recommended settings

input flowLen = 16;
input spectralLen = 7;
input boostVal = 1.3;
input smoothSignals = yes;
input strictness = 5;
input momThresh = 22.0;

https://www.tradingview.com/script/3ONFG3bJ-Omni-Flow-Consensus-LuxAlgo/Original TY Link also attached.

Screenshot 2026-03-20 091703.png


Code:
# ╔══════════════════════════════════════════════════════════════╗
# β•‘       OMNI-FLOW CONSENSUS β€” ThinkScript Conversion          β•‘
# β•‘       Original Pine Script v6 by LuxAlgo                   β•‘
# β•‘       CC BY-NC-SA 4.0                                       β•‘
# β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

declare lower;

# ─── Inputs ──────────────────────────────────────────────────────────────────
input flowLen       = 24;       # Flow Sensitivity
input spectralLen   = 10;       # Spectral Smoothing
input boostVal      = 1.5;      # Signal Boost (1.0 – 5.0)
input smoothSignals = yes;      # Smooth Signals (Reduce Noise)
input strictness    = 3;        # Signal Strictness (1 – 10)
input momThresh     = 15.0;     # Momentum Threshold (0 – 50)
input colorCandles  = yes;      # Gradient Candle Coloring
input showLabels    = yes;      # Display Flow Dashboard

# Color Settings
DefineGlobalColor("Bull",     Color.GREEN);
DefineGlobalColor("Bear",     Color.RED);
DefineGlobalColor("Neutral",  Color.GRAY);
DefineGlobalColor("BullGlow", Color.CYAN);
DefineGlobalColor("BearGlow", Color.MAGENTA);

# ─── Smart Volume & Flow Pressure Index ──────────────────────────────────────
def smart_vol    = if !IsNaN(volume) and volume > 0
                   then volume
                   else TrueRange(high, close, low);

def vol_pressure = (close - open) / Max(high - low, TickSize()) * smart_vol;
def fpi_raw      = Average(vol_pressure, flowLen);

def fpi_high  = Highest(fpi_raw, flowLen * 2);
def fpi_low   = Lowest(fpi_raw,  flowLen * 2);
def fpi_range = Max(fpi_high - fpi_low, TickSize());
def fpi_norm  = ((fpi_raw - fpi_low) / fpi_range * 200) - 100;

# ─── Signal Boost ─────────────────────────────────────────────────────────────
# ThinkScript has no Sign() function β€” replicate manually
def sign_fpi  = if fpi_norm > 0 then 1 else if fpi_norm < 0 then -1 else 0;
def boostFlow = sign_fpi * Power(AbsValue(fpi_norm) / 100, 1 / boostVal) * 100;

# ─── Adaptive Smoothing Function (ASF) ───────────────────────────────────────
# Replicates Pine's asf() β€” an adaptive EMA whose alpha scales with momentum
# relative to ATR, capped at 1.0
def asfAlpha   = 2.0 / (spectralLen + 1);
def asfATR     = Average(TrueRange(high, close, low), spectralLen);
def adaptAlpha = Min(1.0,
                     asfAlpha * (AbsValue(boostFlow - boostFlow[1]) /
                     (asfATR + TickSize())));

# Recursive self-referencing (same semantics as Pine's := assignment)
def flowMain = if IsNaN(flowMain[1])
               then boostFlow
               else flowMain[1] + adaptAlpha * (boostFlow - flowMain[1]);

def flowSig  = ExpAverage(flowMain, 5);

# ─── Regime Detection ─────────────────────────────────────────────────────────
def isBull     = flowMain > 0;
def isTrending = AbsValue(flowMain) > 50;

# ─── Signal Logic ─────────────────────────────────────────────────────────────
def crossUp = if flowMain crosses above flowSig then 1 else 0;
def crossDn = if flowMain crosses below flowSig then 1 else 0;

# Use Sum() to check if a cross occurred within the last `strictness` bars
# more stable than BarsSince() in ThinkScript
def bullConfirm = if Sum(crossUp, strictness) > 0 and flowMain > flowSig
                  then 1 else 0;
def bearConfirm = if Sum(crossDn, strictness) > 0 and flowMain < flowSig
                  then 1 else 0;

# Count consecutive bars of confirmation using a recursive counter
def bullConsec = if bullConfirm then bullConsec[1] + 1 else 0;
def bearConsec = if bearConfirm then bearConsec[1] + 1 else 0;

def impulseBull = if smoothSignals
    then bullConsec == strictness and flowMain > momThresh
    else crossUp and isBull;

def impulseBear = if smoothSignals
    then bearConsec == strictness and flowMain < -momThresh
    else crossDn and isBull == 0;

# ─── Zero Zone ────────────────────────────────────────────────────────────────
plot ZeroAxis = 0;
ZeroAxis.SetDefaultColor(Color.GRAY);
ZeroAxis.SetLineWeight(2);
ZeroAxis.SetStyle(Curve.FIRM);

plot ZoneTop = 10;
ZoneTop.Hide();
plot ZoneBot = -10;
ZoneBot.Hide();
AddCloud(ZoneTop, ZoneBot, Color.LIGHT_GRAY, Color.LIGHT_GRAY);

# ─── Overbought / Oversold Reference Lines ────────────────────────────────────
plot OB_Inner = 70;
OB_Inner.SetDefaultColor(Color.DARK_GRAY);
OB_Inner.SetStyle(Curve.SHORT_DASH);
OB_Inner.SetLineWeight(1);

plot OB_Outer = 90;
OB_Outer.SetDefaultColor(Color.DARK_GRAY);
OB_Outer.SetStyle(Curve.SHORT_DASH);
OB_Outer.SetLineWeight(1);

plot OS_Inner = -70;
OS_Inner.SetDefaultColor(Color.DARK_GRAY);
OS_Inner.SetStyle(Curve.SHORT_DASH);
OS_Inner.SetLineWeight(1);

plot OS_Outer = -90;
OS_Outer.SetDefaultColor(Color.DARK_GRAY);
OS_Outer.SetStyle(Curve.SHORT_DASH);
OS_Outer.SetLineWeight(1);

# ─── Main Flow & Signal Lines ─────────────────────────────────────────────────
plot FlowMainPlot = flowMain;
FlowMainPlot.SetLineWeight(4);
FlowMainPlot.AssignValueColor(
    if !isTrending then GlobalColor("Neutral")
    else if isBull  then GlobalColor("Bull")
    else GlobalColor("Bear")
);

plot SignalLinePlot = flowSig;
SignalLinePlot.SetLineWeight(1);
SignalLinePlot.AssignValueColor(
    if !isTrending then GlobalColor("Neutral")
    else if isBull  then GlobalColor("Bull")
    else GlobalColor("Bear")
);

# Momentum fill between FlowMain and SignalLine
# Bull fill when flowMain > flowSig, bear fill when below
AddCloud(FlowMainPlot, SignalLinePlot,
    GlobalColor("BullGlow"),
    GlobalColor("BearGlow")
);

# ─── Impulse Signal Markers ───────────────────────────────────────────────────
# Pine uses diamond glyphs at price; closest ThinkScript equivalent is arrows
plot BullImpulse = if impulseBull then flowMain else Double.NaN;
BullImpulse.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
BullImpulse.SetDefaultColor(GlobalColor("BullGlow"));
BullImpulse.SetLineWeight(3);

plot BearImpulse = if impulseBear then flowMain else Double.NaN;
BearImpulse.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
BearImpulse.SetDefaultColor(GlobalColor("BearGlow"));
BearImpulse.SetLineWeight(3);

# ─── Candle Coloring ──────────────────────────────────────────────────────────
# Note: Pine uses color.from_gradient for a smooth ramp; ThinkScript has no
# direct equivalent, so we apply a flat bull/bear color instead.
AssignPriceColor(
    if !colorCandles then Color.CURRENT
    else if isBull   then GlobalColor("Bull")
    else GlobalColor("Bear")
);

# ─── Dashboard Labels ─────────────────────────────────────────────────────────
# Pine renders a table; ThinkScript equivalent is AddLabel (top of chart).
AddLabel(showLabels, "OMNI-FLOW CONSENSUS", Color.WHITE);

AddLabel(showLabels,
    "Regime: " + (if !isTrending then "ACCUMULATION"
                  else if isBull  then "BULLISH FLOW"
                  else "BEARISH FLOW"),
    if !isTrending then GlobalColor("Neutral")
    else if isBull  then GlobalColor("BullGlow")
    else GlobalColor("BearGlow")
);

AddLabel(showLabels,
    "Flow: " + Round(AbsValue(flowMain), 0) + "%",
    Color.WHITE
);

AddLabel(showLabels,
    "Status: " + (if impulseBull then "BULL INJECT"
                  else if impulseBear then "BEAR INJECT"
                  else "NEUTRAL"),
    if impulseBull  then GlobalColor("BullGlow")
    else if impulseBear then GlobalColor("BearGlow")
    else Color.WHITE
);

# ─── Alerts ───────────────────────────────────────────────────────────────────
Alert(impulseBull, "Bullish Flow Injection Confirmed",  Alert.BAR, Sound.Ding);
Alert(impulseBear, "Bearish Flow Injection Confirmed",  Alert.BAR, Sound.Ding);
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
584 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • β€˜Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top