5D/25D Moving Average Signals

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

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.