5D/25D Moving Average Signals

5D/25D Moving Average Signals Indicator – Technical Documentation
This document explains the functionality, logic, and components of the 5D/25D Moving Average Signals indicator written in Pine Script v6.
Overview
The indicator compares a 5‑day and 25‑day moving average based on true daily candles, regardless of the chart timeframe. It highlights trend direction, plots moving averages, marks bullish/bearish crossovers, and offers alert conditions.
Key Features
• Uses true daily moving averages via request.security().
• Selectable SMA or EMA type.
• Background highlighting for trend direction.
• Bullish and bearish crossover arrows.
• Customizable colors, line width, and opacity.
• Optional status label on the last bar.
• Non-repainting behavior due to barmerge.lookahead_off.
Interpretation
• When the 5‑day MA is above the 25‑day MA → Bullish trend.
• When the 5‑day MA is below the 25‑day MA → Bearish trend.
• Crossovers produce trade signals and alerts.
Non‑Repainting Logic
Using barmerge.lookahead_off ensures the daily MAs are calculated only when the daily candle closes, preventing repainting on intraday charts.
This document explains the functionality, logic, and components of the 5D/25D Moving Average Signals indicator written in Pine Script v6.
Overview
The indicator compares a 5‑day and 25‑day moving average based on true daily candles, regardless of the chart timeframe. It highlights trend direction, plots moving averages, marks bullish/bearish crossovers, and offers alert conditions.
Key Features
• Uses true daily moving averages via request.security().
• Selectable SMA or EMA type.
• Background highlighting for trend direction.
• Bullish and bearish crossover arrows.
• Customizable colors, line width, and opacity.
• Optional status label on the last bar.
• Non-repainting behavior due to barmerge.lookahead_off.
Interpretation
• When the 5‑day MA is above the 25‑day MA → Bullish trend.
• When the 5‑day MA is below the 25‑day MA → Bearish trend.
• Crossovers produce trade signals and alerts.
Non‑Repainting Logic
Using barmerge.lookahead_off ensures the daily MAs are calculated only when the daily candle closes, preventing repainting on intraday charts.
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.
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.