Viprasol Naive Bayes Order Flow
Jun 3, 2026

The Viprasol Naive Bayes Order Flow indicator classifies order-flow conditions using a Naive Bayes classifier trained on Cumulative Volume Delta (CVD) features to identify probabilistic market regimes. It provides traders with a data-driven read on whether buying or selling pressure is dominating while applying advanced signal-filtering techniques to reduce noise.
Usage
The Usage section describes how the script can be used to identify trend regimes and potential entry points based on volume flow.
Signal Interpretation
- Long Signals: Represented by circles (high conviction) or triangles (normal) below the bar. These fire when the Bull posterior probability exceeds the entry threshold, price is above the trend EMA, and CVD is rising.
- Short Signals: Represented by circles or triangles above the bar. These fire when the Bear posterior probability exceeds the threshold, price is below the trend EMA, and CVD is falling.
- Regime Background: Shaded areas indicate the dominant market state: Green for Bullish flow, Red for Bearish flow, and Blue for Diverged/Conflicted flow.
Filtering and Confluence
Traders can refine signals by enabling the Volume Surge filter, which requires the signal bar's volume to exceed its rolling average by a user-defined multiplier. The Signal Cooldown setting is used to prevent rapid-fire signals during high volatility, enforcing a minimum bar gap between entries.
Details
The script utilizes a Naive Bayes classifier trained on three primary features derived from Cumulative Volume Delta (CVD):
- CVD Rate of Change: Measures momentum in volume flow.
- Price/Flow Divergence: Identifies when price moves without matching volume delta.
- CVD Slope: Captures the acceleration of flow using linear regression.
The classifier assigns every bar to a Bull, Bear, or Diverged class. Using Gaussian Probability Density Functions, it calculates the "posterior probability" for each class. A signal is generated only when the probability of a specific regime crosses the defined Entry Threshold. This version includes a live Hit Rate diagnostic, which compares the classifier's most likely prediction against the realized market outcome on the following bar.
Settings
Naive Bayes Classifier
- Classifier Lookback: The number of bars required for the classifier to train before signals become active.
- Entry Threshold: The minimum posterior probability required to trigger a signal.
- Prior Bull Probability: The initial baseline belief for market direction.
CVD Features
- CVD Momentum Period: Look-back period for calculating CVD and price rate-of-change.
- CVD Slope Period: The window for linear regression on the CVD line.
- Z-Score Window: The normalization window used to standardize classifier features.
Signal Filters (Viprasol)
- Signal Cooldown: Minimum number of bars that must elapse between consecutive signals.
- Require Bar-Close Confirmation: When enabled, signals only trigger once the bar has fully closed.
- Require Volume Surge: Gates signals based on whether volume exceeds a moving average.
Signal Levels & Visuals
- SL ATR Multiplier / Risk:Reward: Configures the automated stop-loss and take-profit projection lines.
- Trend EMA Period: Determines the trend filter; longs only trigger above this line, shorts below.
- Posterior Band: A visual ATR band that scales in opacity based on classifier confidence.
FAQ
How do I interpret the Hit Rate in the dashboard?
The Hit Rate is an in-sample diagnostic showing how often the classifier's most likely class matched the actual market label on the next bar. It is a measure of classification accuracy, not a trading win rate.
Why are there no signals appearing on my chart?
The indicator requires a "warmup" period (defined by the Classifier Lookback) to train on historical data. Ensure the dashboard status reads "LIVE" rather than "WARMUP."
How can I access the Viprasol Naive Bayes Order Flow?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.