OPEN-SOURCE SCRIPT
Aktualisiert Boshmann's Market Direction Hist

Boshmann's Market Direction Hist
The theory behind a directional histogram is to visually quantify not just the direction of a trend, but its underlying momentum and the distance between moving averages. While identifying a trend regime categorizes the market into a fixed state (bull, bear, or sideways), measuring the spread between a fast and slow moving average reveals whether that trend is accelerating, decelerating, or reaching exhaustion. By projecting this spread as an oscillator around a zero line, traders can easily spot momentum divergences and gauge the true strength of a directional move.
How the Script Works: The script calculates the raw distance between a short-term moving average (20-period SMA) and a long-term moving average (100-period SMA). To ensure the indicator works seamlessly across any asset class or timeframe—whether a stock is trading at $5 or $50,000—it normalizes this distance as a percentage of the current price. It then plots this normalized momentum as a histogram. Finally, the histogram bars are painted using the exact same logic as the Regime Counters script: Green for Strong Bull, Red for Strong Bear, and Yellow for Sideways.
Why You Should Use It: This script is explicitly designed to be used in combination with the Regime Counters and Volatility Histogram scripts to form a complete, three-dimensional view of the market.
A user should use this histogram because while the Regime Counter tells you what state the market is in, the Direction Histogram tells you how strong that state is. For example, if the Regime Counter classifies the market as "Bullish" but you see the green bars on this histogram steadily shrinking toward the zero line, it is a leading indicator that upward momentum is dying long before the official regime flips. Together, the three scripts allow you to trade systematically: the Regime Counter dictates your directional bias, the Volatility script warns you of price expansion, and the Direction Histogram measures the real-time conviction pushing the trend.
The theory behind a directional histogram is to visually quantify not just the direction of a trend, but its underlying momentum and the distance between moving averages. While identifying a trend regime categorizes the market into a fixed state (bull, bear, or sideways), measuring the spread between a fast and slow moving average reveals whether that trend is accelerating, decelerating, or reaching exhaustion. By projecting this spread as an oscillator around a zero line, traders can easily spot momentum divergences and gauge the true strength of a directional move.
How the Script Works: The script calculates the raw distance between a short-term moving average (20-period SMA) and a long-term moving average (100-period SMA). To ensure the indicator works seamlessly across any asset class or timeframe—whether a stock is trading at $5 or $50,000—it normalizes this distance as a percentage of the current price. It then plots this normalized momentum as a histogram. Finally, the histogram bars are painted using the exact same logic as the Regime Counters script: Green for Strong Bull, Red for Strong Bear, and Yellow for Sideways.
Why You Should Use It: This script is explicitly designed to be used in combination with the Regime Counters and Volatility Histogram scripts to form a complete, three-dimensional view of the market.
A user should use this histogram because while the Regime Counter tells you what state the market is in, the Direction Histogram tells you how strong that state is. For example, if the Regime Counter classifies the market as "Bullish" but you see the green bars on this histogram steadily shrinking toward the zero line, it is a leading indicator that upward momentum is dying long before the official regime flips. Together, the three scripts allow you to trade systematically: the Regime Counter dictates your directional bias, the Volatility script warns you of price expansion, and the Direction Histogram measures the real-time conviction pushing the trend.
Versionshinweise
Boshmann's Direction Histogram v2 (Normalized)Most momentum and trend indicators have aflaw: their values are tied to the raw price of the asset. A Moving Average spread of 50 points is massive on a $100 stock, but completely meaningless on the S&P 500 or Bitcoin. This makes it hard to build or use universal scanners or compare trend strength across different markets.
Version 2 solves this by introducing pure ATR Normalization.
Instead of measuring the distance between Moving Averages in raw price points, this histogram measures the spread in "units of Volatility" (Average True Range). This mathematically standardizes the indicator, meaning a reading of 3.0 represents the exact same level of trend extension whether you are trading Crypto, Forex, or Stocks.
How to Read the Chart
- The Colors Tell You the Market Regime:
Solid Green (Bull): Full alignment. Price is above the baseline structural trend (200 SMA - you can change this parameter), and the short-term trend is leading the long-term trend upward.
Solid Red (Bear): Full alignment. Price is below the structural trend, and the short-term trend is pulling the long-term trend downward.
Golden (Sideways/Transition): The market is fighting itself. For example, the short-term trend has crossed bearishly below the long-term trend, but the price is still hovering above the 200 SMA. This visually warns you of a choppy regime transition before a full trend takes over.
Example: Let's say you load this on a chart and the Green histogram peaks at 6.00. This instantly tells you: "The short-term trend is currently stretched 6 times the average daily volatility above the long-term trend." This represents a violently strong, historically overextended Bull market.
Conversely, if the histogram dips to -3.00 in the Red, the short-term trend is 3 ATRs below the long-term trend, showing strong bearish momentum.
This standardization gives you the possibility to visually scan a variety of assets and instantly identify which ones are historically overextended and which ones are just starting to build fresh momentum.
Note: For the ultimate market analysis framework, use this histogram in conjunction with the Boshmann's Volatility Histogram and the Boshmann's Regime Counters to map out the complete "market weather" on your chart.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.