OPEN-SOURCE SCRIPT

5-Day SMA Trend Indicator (30m)

103
This 5-Day SMA Trend Indicator is a simple yet powerful tool designed to help traders visualize short-term trend strength and direction. It analyzes the 5-day simple moving average (SMA) on an intraday timeframe (default: 30 minutes) to determine whether the market is in a bullish or bearish short-term trend.

Key Features:

✅ 5-Day SMA Calculation – Plots a 5-period simple moving average (SMA) on an intraday chart
✅ Trend Detection – Identifies when the SMA is rising or falling
✅ Price Positioning – Determines whether price is above or below the SMA
✅ Color-Coded Background –
• 🟩 Green → Price is above a rising SMA (bullish trend)
• 🟥 Red → Price is below a falling SMA (bearish trend)
✅ Intraday Analysis – Uses 30-minute candles by default, but you can adjust the timeframe

How It Works:
1. The script calculates the 5-day SMA using intraday price data.
2. It determines if the SMA is rising (bullish) or falling (bearish) by checking the slope of the moving average.
3. It checks if the current price is above or below the SMA.
4. If price is above a rising SMA, the background turns green (bullish signal).
5. If price is below a falling SMA, the background turns red (bearish signal).
6. If neither condition is met, no background color is applied.

Use Cases:

📌 Trend Confirmation – Helps traders confirm if a rally is sustainable or likely to fail
📌 Entry & Exit Signals – Can assist in timing buy and sell decisions based on short-term trend direction
📌 Risk Management – Avoid buying into weak rallies below a falling SMA

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.