OPEN-SOURCE SCRIPT
EMAs + LSMA Cross Alert (Mejorado)

his indicator is designed to identify buy and sell signals based on the behavior of multiple exponential moving averages (EMAs) and a Least Squares Moving Average (LSMA). It includes 5 EMAs and one LSMA, with visual and alert features.
📌 Components:
EMA 4 (purple)
EMA 9 (Fuchsia)
EMA 21 (blue)
EMA 50 (Green)
EMA 200 (maroon)
LSMA 30 (Orange)
🔍 Signal Logic:
✅ Buy Signal:
The LSMA (30) must be below both EMA 4 and EMA 9.
A bullish crossover occurs: EMA 4 crosses above EMA 9.
Only one signal is triggered per crossover, avoiding repeated alerts during trend continuation.
❌ Sell Signal:
The LSMA (30) must be above both EMA 4 and EMA 9.
A bearish crossover occurs: EMA 4 crosses below EMA 9.
Only one signal is triggered per crossover, avoiding repeated alerts during trend continuation.
🖥️ Visual Features:
Option to show/hide each EMA and the LSMA.
Buy/Sell markers appear at cross points.
A white background highlight marks the candle where the signal occurs (optional).
Visuals scale dynamically with the chart zoom and axes.
🔔 Alerts:
Custom alert conditions for Buy and Sell.
Alerts can trigger push notifications to the TradingView mobile app, email, or webhook.
Configured to avoid repeating alerts unless the trend resets and a new valid crossover occurs.
📌 Components:
EMA 4 (purple)
EMA 9 (Fuchsia)
EMA 21 (blue)
EMA 50 (Green)
EMA 200 (maroon)
LSMA 30 (Orange)
🔍 Signal Logic:
✅ Buy Signal:
The LSMA (30) must be below both EMA 4 and EMA 9.
A bullish crossover occurs: EMA 4 crosses above EMA 9.
Only one signal is triggered per crossover, avoiding repeated alerts during trend continuation.
❌ Sell Signal:
The LSMA (30) must be above both EMA 4 and EMA 9.
A bearish crossover occurs: EMA 4 crosses below EMA 9.
Only one signal is triggered per crossover, avoiding repeated alerts during trend continuation.
🖥️ Visual Features:
Option to show/hide each EMA and the LSMA.
Buy/Sell markers appear at cross points.
A white background highlight marks the candle where the signal occurs (optional).
Visuals scale dynamically with the chart zoom and axes.
🔔 Alerts:
Custom alert conditions for Buy and Sell.
Alerts can trigger push notifications to the TradingView mobile app, email, or webhook.
Configured to avoid repeating alerts unless the trend resets and a new valid crossover occurs.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.