1m + 5m Market Structure
Apr 1, 2026

The 1m + 5m Market Structure indicator provides a comprehensive visual framework for identifying trend direction and swing points across multiple timeframes. It utilizes dual Exponential Moving Averages (EMA) to determine trend bias while identifying high and low swing ranges based on Williams %R overbought and oversold conditions.
Usage
The script is primarily designed for intraday traders looking to synchronize short-term price action with structural shifts.
- Trend Identification: Candles are colored based on the relationship between price and two EMAs (30 and 120 by default). Green candles indicate a bullish trend (Price > EMA1 and EMA1 > EMA2), while red candles indicate a bearish trend (Price < EMA1 and EMA1 < EMA2). Neutral conditions are colored blue.
- Swing Analysis: The tool automatically plots labels for 1-minute and 5-minute swings. These labels mark the "High" and "Low" of a movement and display the price range (distance) from the previous opposite swing.
- Market Context: An ADX filter is included to help users distinguish between trending and ranging markets, with the option to highlight the background when the ADX exceeds a specific threshold.
Details
The indicator employs a state machine logic to track swings accurately. 1-minute swings are calculated based on real-time Williams %R crossovers of overbought/oversold levels. For the 5-minute swings, the script uses request.security to fetch data from the 5-minute timeframe, ensuring labels only generate on confirmed bar closes to prevent repainting of historical structural points. The "Range" displayed on labels is calculated as the absolute difference between the current swing peak/trough and the preceding structural low/high.
Settings
Williams %R
- WR Length: Sets the lookback period for the Williams %R calculation used for swing detection.
- Overbought Level: The upper threshold (default -20) for identifying potential swing highs.
- Oversold Level: The lower threshold (default -80) for identifying potential swing lows.
EMA Settings
- EMA 1 & 2 Length: Defines the periods for the fast and slow moving averages used for trend filtering.
- EMA 1 & 2 Color: Customizes the visual representation of the trend lines.
ADX Settings
- ADX Length: The period for the Average Directional Index calculation.
- ADX Threshold: The level above which the market is considered to be trending.
- Show ADX Background: Toggles a background highlight based on the ADX threshold.
Labels & Colors
- Show 1m/5m Labels: Enables or disables the structural swing labels for each respective timeframe.
- Candle Colors: Allows customization of the Bull, Bear, and Neutral candle overlays.
FAQ
How do I interpret the range values on the labels? The values represent the price distance from the previous confirmed swing high or low, helping you quantify the magnitude of the current market move.
Why are some candles blue instead of green or red? Blue candles represent a "Neutral" state where the price action or the EMA alignment does not meet the strict criteria for a confirmed bullish or bearish trend.
How can I access 1m + 5m Market Structure? 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.