OPEN-SOURCE SCRIPT

Diwali Lights Pro — 7-Diyas Signal Matrix [KedArc Quant]

320
🎯 Overview

“Diwali Lights Pro — 7-Diyas Signal Matrix” is a precision-built trend-sentiment indicator that blends the glow of seven technical “diyas” — each representing a different momentum or strength dimension — into one intuitive signal matrix. It was designed to celebrate light, discipline, and clarity in trading — helping traders filter noise, identify strong trend shifts, and take trades with conviction. Each diya is powered by a proven indicator component: RSI, Stochastic, EMA trend strength, and momentum slopes.Together, they light up your chart with buy/sell signals only when technical confluence aligns — like the diyas of Diwali shining in harmony.

💡 Core Concept

The indicator computes a composite score (–9 to +9) by evaluating seven key parameters:

| # | Diya | Logic | Interpretation |
| 1 | RSI | Overbought / Oversold | Short-term momentum exhaustion |
| 2 | Stochastic | Direction & zones | Confirmation of RSI |
| 3 | Price vs EMA20 | Position of price | Near-term trend bias |
| 4 | EMA20 Slope | Short-term momentum | Strength confirmation |
| 5 | EMA50 Slope | Mid-term trend | Trend stability |
| 6 | EMA100 Slope | Medium-term sentiment | Institutional bias |
| 7 | EMA200 Slope | Long-term sentiment | Market direction baseline |

The total of these 7 diyas creates a signal matrix that dynamically adapts to trend conditions.

⚙️ Inputs & Configuration

| RSI Length | 14 | Standard RSI window |
| Stochastic Length | 14 | Measures momentum oscillation |
| EMA Periods | 20, 50, 100, 200 | Multi-layer trend structure |
| Overbought / Oversold Zones | 70 / 30 | Configurable thresholds |
| Show Buy/Sell Labels | ✅ | Toggle signal markers |
| Show Banner | ✅ | Festive Diwali header with fireworks |
| Twinkle Interval | 10 bars | Animation timing |
| Fireworks Count | 18 | Visual celebration intensity |
| Background Opacity | 100% | Style preference |



🧭 Entry & Exit Logic

# ✅ Buy Signal (🪔)

A Buy triggers when:

* The total diya score crosses above zero,
* And at least four of seven components turn bullish.

This indicates that short-term oscillators, price action, and moving averages are all turning in unison — a strong entry zone after a pullback.

# 🔥 Sell Signal (🔥)

A Sell triggers when:

* The total diya score crosses below zero,
* And multiple slopes or price conditions flip bearish.

This flags weakening momentum and possible trend exhaustion.

# 💬 Suggested Usage

* Works beautifully on 5-min to 1-hour charts.
* Best when used with trend confirmation tools (volume, price structure).
* Avoid entering trades when signals flip rapidly within narrow ranges (sideways zones).



🧪 Mathematical Formulae

1. RSI Bucket (p₁):

p₁ =
2 if RSI < Very Oversold
1 if RSI < Oversold
0 if neutral
-1 if RSI > Overbought
-2 if RSI > Very Overbought

2. Stochastic Bucket (p₂): Similar to RSI bucketing.
3. Price vs EMA20 (p₃):
p₃ = sign(close - EMA20)
4–7. Slope Sign (EMA20, 50, 100, 200):
p₄₋₇ = sign(EMA[n] - EMA[n][1])

Total Score = Σ(p₁…p₇)
→ Crossover(total_score, 0) → Buy Signal
→ Crossunder(total_score, 0) → Sell Signal


📊 Why It’s Not Just a Mash-Up

Diwali Lights Pro uses:

* A unified scoring engine with weighted logic rather than conflicting triggers.
* Each component (diya) contributes equally, creating a normalized sentiment index.
* Smart signal filtering prevents repetitive false flips by enforcing trend alignment across multiple time frames.
* A dynamic, responsive structure optimized for clarity and minimal repainting.


🎆 Unique Add-Ons

* Top-Right Diwali Banner: Festive “Happy Diwali” with animated fireworks 🎇 and diyas 🪔.
* Signal Filtering: Reduces noise in volatile ranges.
* EMA Cloud Context: Visual clarity of multi-layer trend zones.
* Optional Light Mode: Change fireworks opacity for a subtle or bright effect.


📘 FAQ

Q1: Does this repaint?
No — it uses confirmed values (RSI, Stochastic, EMA slopes). Signals appear only after the bar closes.

Q2: Which timeframes work best?
Between 5m and 1h, depending on your strategy.
Use higher EMAs for swing setups.

Q3: Can I use it with alerts?
Yes, both Buy and Sell triggers come with built-in `alertcondition()` for instant notifications.

Q4: Can it be combined with other indicators?
Absolutely — it pairs well with volume profiles, volatility bands, or order-flow systems.



🪔 Glossary

| Diya | Candle or light — here, each diya = one technical indicator |
| EMA | Exponential Moving Average — measures smoothed trend bias |
| RSI | Relative Strength Index — momentum overbought/oversold oscillator |
| Stochastic | Momentum oscillator measuring closing levels relative to highs/lows |
| Slope Sign | Direction of EMA movement — rising or falling |
| Signal Matrix | The combined system of all seven diyas generating a unified score |

🧭 Final Note

> *Diwali Lights Pro* is not just a trading tool — it’s a visual celebration of confluence and discipline.
> When the diyas align, trends shine. Use it to trade in harmony with light, not against it. 🌟

⚠️ Disclaimer
This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.