Stan Weinstein 30-week Moving Average
May 12, 2021

The Stan Weinstein 30-week Moving Average indicator visualizes the core trend-following component of Weinstein’s Stage Analysis to help traders identify market cycles and long-term trend transitions.
Usage
The Usage section describes how the script can be used to identify the four market stages defined by Stan Weinstein. Traders typically use this tool on weekly timeframes to determine the health and direction of a security.
- Stage 1 (Basing): Occurs when the price moves sideways around a flattening 30-week moving average. This represents a period of indifference or accumulation.
- Stage 2 (Advancing): Confirmed when the price breaks above the resistance of the base and stays above a rising 30-week moving average. This is the ideal stage for long positions.
- Stage 3 (Top Area): Characterized by the price moving sideways again while the 30-week moving average flattens out. This indicates distribution and a loss of momentum.
- Stage 4 (Declining): Confirmed when the price breaks below the support of the top area and remains below a falling 30-week moving average. This indicates a sustained downtrend.
The script also plots a 150-day moving average, which is the daily equivalent of the 30-week line, allowing traders to maintain perspective on the long-term trend even when viewing lower timeframes.
Details
The script utilizes the request.security function to ensure that the moving averages are calculated based on their specific timeframes (Weekly and Daily) regardless of the timeframe currently active on the chart.
Weinstein’s methodology emphasizes the slope and position of the 30-week Simple Moving Average (SMA) as the primary filter for trend strength. By monitoring the relationship between the current price and these averages, the script identifies potential entry points during Stage 2 breakouts or exit points when a Stage 4 decline begins. Built-in alerts trigger when the price crosses these key levels to notify users of potential stage transitions.
Settings
- Long Term Weekly SMA: Sets the length for the weekly Simple Moving Average calculation (default is 30 weeks).
- Long Term Daily SMA: Sets the length for the daily Simple Moving Average calculation (default is 150 days).
FAQ
How do I identify a Stage 2 breakout using this tool? A Stage 2 breakout is typically identified when the price closes decisively above the 30-week moving average while the moving average itself begins to slope upward.
Can I use this indicator on intraday timeframes? Yes, the script is designed to fetch weekly and daily data automatically, so the 30-week and 150-day averages will remain consistent even if you switch to an hourly or 15-minute chart.
How can I access the Stan Weinstein 30-week Moving Average? 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.