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.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.