Indicator · Pine Script v5 · On the chart

Markov Regime - Bull / Bear / Sideways

by jackson-video-resources

This indicator classifies each bar as bull, bear, or sideways from a rolling log return compared with adjustable percentage thresholds.

View on GitHub

GitHub stars493on the repository
Pine versionv5runs as is
Lines of code410
Settings14inputs
LicenceCustom licence
Last update5 months ago20 May 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

Markov Regime - Bull / Bear / Sideways paints a regime ribbon on the price chart, shows a current-regime banner, and labels state changes after a minimum hold. From visible chart history it estimates a three-by-three transition matrix and a stationary distribution, both drawn as corner tables. Lookback, thresholds, iteration count, and table positions are user settings. It does not place trades.

Details

Published by

jackson-video-resources on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Screeners & dashboards

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
Lookback window (bars)int20lookback_window
Bull threshold (%)float5.0bull_threshold_pct
Bear threshold (%)float5.0bear_threshold_pct
Stationary power (iterations)int50stationary_power
Show regime ribbonbooltrueshow_regime_ribbon
Show current-regime bannerbooltrueshow_regime_banner
Show transition matrixbooltrueshow_matrix_table
Show stationary distributionbooltrueshow_stationary_table
Label state transitions on chartbooltrueshow_transition_labels
Table text sizestringhugetable_text_size
Min bars a regime must hold to be labelledint4min_regime_hold
Banner positionstringtop_leftbanner_position_input
Show all 14 settings
SettingTypeDefaultVariable
Matrix positionstringtop_rightmatrix_position_input
Stationary positionstringbottom_rightstationary_position_input
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

257 stars

This indicator overlays an intraday SPX and ES chart with a midnight session range, regular-trading-hours opening levels, and a VWAP projection box. It draws the midnight high, mid, and low, flags edge rejections within an absolute tolerance, and plots optiona

Indicator v6 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of SPX Midnight Box + Snag Logic
218 stars

TradersPost Trading Checklist is an overlay indicator that evaluates a suite of popular technical conditions for long and short trade setups. It checks session-anchored VWAP, fast and slow EMA alignments and crosses, 200 SMA, RSI overbought or oversold conditi

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of TradersPost Trading Checklist
92 stars

This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It

Indicator v5 Volatility & bandsTrend
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev GEX Regime & Trap

EMA Ribbon Overlay

by iamrichardD
57 stars

Calculates exponential moving averages for fast, pivot, and slow lengths along with optional 50, 100, and 200 simple moving average context lines. It visualizes bullish and bearish ribbon fills on the main price chart alongside MACD calculations to generate ea

Indicator v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon Overlay
53 stars

Apex Trend & Liquidity Master calculates a trend cloud using customizable moving averages expanded by a volatility multiplier directly on the main price chart. It identifies dynamic support and resistance liquidity zones from swing high and low pivots, extendi

Indicator v6 TrendSupport & resistance
Updated 2 months ago · MPL-2.0 GitHub repository of Apex Trend & Liquidity Master

Confluence Suite

by TamaraKGreen
46 stars

The Confluence Suite indicator draws multiple trading signals and tools directly on the price chart. It generates entry and exit signals based on selected modes and filters, with an AI signal classifier rating quality from 1-4. Additional features include smar

Indicator v5 TrendSMC / ICT / price action
Updated 7 weeks ago · None stated GitHub repository of Confluence Suite

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