5D/25D Moving Average Signals

682
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.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.