Indicator · Pine Script v6 · Own pane

Expectation Maximization Gaussian Mixture Regime

by ChartsLector

The Expectation Maximization Gaussian Mixture Regime indicator clusters market states into two to five components using an online Expectation-Maximization Gaussian Mixture Model.

View on GitHub

GitHub stars41on the repository
Pine versionv6current
Lines of code718
Settings23inputs
LicenceNone stated
Last update2 days ago26 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Expectation Maximization Gaussian Mixture Regime processes three input features: volatility-normalized momentum, relative volatility, and relative volume. Operating in a separate pane, the indicator renders histograms, color gradients, entropy certainty metrics, and optional regime background shading, along with a diagnostics table. Users can configure learning memory length, feature lookback horizons, EM initialization thresholds, component numbers, and visual toggles.

Details

Published by

ChartsLector on GitHub

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

AI / machine learning, Oscillators & momentum, Volatility & bands, Volume

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Effective learning memoryint100memoryLength
Gaussian componentsint3nComponents
Initialization sampleint75initializationBarsInput
Initialization EM iterationsint15initializationIterations
EM relative tolerancefloat0.0001convergenceTolerance
Variance floorfloat0.05varianceFloor
Minimum component weightfloat0.01minimumWeight
Momentum horizonint14momentumLength
Short volatility horizonint20volatilityLength
Relative-volume horizonint50volumeLength
Feature clippingfloat6.0featureClip
Oscillator smoothingint3smoothing
Show all 23 settings
SettingTypeDefaultVariable
Show gradientbooltrueshowGradient
Show histogrambooltrueshowHistogram
Show regime backgroundbooltrueshowRegime
Show entropy certaintybooltrueshowCertainty
Color price barsboolfalsebarColoring
Show diagnostics tablebooltrueshowDiagnostics
Table positionstringTop RightdiagnosticsPositionInput
Detail levelstringStandarddiagnosticsDetailLevel
Text sizestringTinydiagnosticsTextSizeInput
Background transparencyint78diagnosticsBackgroundTransparency
Show during initialization warm-upbooltrueshowDiagnosticsDuringWarmup
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

This indicator uses a two-dimensional k-nearest-neighbours model on scaled oscillator values to classify the current bar as buy, sell, or hold from similar historical states. Users select RSI, ROC, CCI, momentum, or all of them, and set the neighbour count, fa

Indicator v4 AI / machine learningOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Machine Learning: kNN-based Strategy (update)
114 stars

This indicator standardizes price inputs using z-score normalization before calculating a relative strength index (RSI). It generates trade signals when standardized price components cross over or under the standardized RSI feature. Signals can be filtered by

Indicator v4 Oscillators & momentumVolatility & bands Repaints
Updated 1 year ago · None stated GitHub repository of Preprosessed & Standardized RSI

This indicator plots an oscillator in a separate pane. It builds several SuperTrend series across a user-defined factor range and step, using ATR as the band width. On each bar it measures the distance between the close and each SuperTrend output, then groups

Indicator v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of AI SuperTrend Clustering Oscillator [LuxAlgo]

PPO ATR Bands

by cryptorife
75 stars

PPO ATR Bands plots a percentage price oscillator in a separate pane. It compares a Hull average of typical price with a volume-weighted exponential average of Parabolic SAR, then scales three true-range bands around the slow average into matching oscillator l

Indicator v4 Oscillators & momentumMoving averages
Updated 3 years ago · GPL-3.0 GitHub repository of PPO ATR Bands

This indicator calculates the Relative Strength Index (RSI) alongside a simple moving average to generate directional momentum signals in a separate pane. It supports Break Flip and Break Continuous scanning modes for long and short setups. A wide array of opt

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of Momentum Setup: RSI Direction Confirmation

NFI v6

by koradiyakaushal
12 stars

This Pine v4 study ports early NostalgiaForInfinity V6 conditions onto the price chart. It computes two Bollinger setups, several EMAs and SMAs, RSI, MFI, a percent SMA spread labeled EWO, a 14-period choppiness value, and short and longer volume medians. Fixe

Indicator v4 Moving averagesVolatility & bands
Updated 5 years ago · MIT GitHub repository of NFI v6

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers