Market Structure MA Based BOS
Jan 14, 2023

The Market Structure MA Based BOS indicator identifies market structure shifts by utilizing Moving Average (MA) crossovers to define swing points rather than traditional pivot methods. This approach allows for the early detection of Break of Structure (BOS) levels, providing traders with timely signals for trend continuation or reversals in high-volatility markets.
Usage
The tool is primarily used to identify market structure breaks in trending environments. When the price crosses a Moving Average, the script identifies the highest or lowest point of that cycle as a swing point. Once price breaks past these identified swing levels, a "BOS" label and line are drawn on the chart.
- Trend Continuation: In a trending market, a BOS signal can be used as an opportunity to add to existing positions or confirm the strength of the current trend.
- Volatility Awareness: The indicator is most effective in high-volatility markets; signals in low-volatility or ranging markets may lack significance.
- Early Entry: Because it uses MA-based swing points instead of standard
ta.pivothigh()functions, the signals often appear earlier during the initial stages of a trend.
Details
The indicator logic relies on the relationship between price action and a selected Moving Average.
- Swing Identification: When the price crosses over or under the MA, the script marks the highest high or lowest low of that period as a swing point.
- Break Detection: If the price subsequently breaks through these marked swing levels, a Break of Structure is confirmed.
- Visualization: The script includes options to display the underlying Moving Average, cross signals, and an optional Zigzag line to visualize the internal structure identified by the MA.
Settings
GRP1
- MA_Type: Select the type of Moving Average used for structure calculation (EMA, RMA, SMA, HMA, or WMA).
- short_ma_len: Determines the lookback period for the Moving Average, affecting the sensitivity of swing point detection.
GRP2
- Show short-len Zigzag: Toggles the visibility of the Zigzag lines connecting identified swing points.
- Show ma cross signal: Enables or disables plot characters (triangles) when the price crosses the Moving Average.
- Zig Zag Line Styles: Customizes the visual appearance of the Zigzag lines (Dashed, Dotted, or Solid).
FAQ
How do I use the BOS signals?
BOS signals indicate that the market has surpassed a previous swing level defined by the Moving Average. Traders often use these to confirm trend direction or as entry triggers for momentum trades.
Why does this use MAs instead of Pivots?
Using Moving Averages to define swings often results in faster identification of structure changes compared to standard pivot functions, which typically require a fixed number of bars to confirm a high or low.
How can I access Market Structure MA Based BOS?
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.