OPEN-SOURCE SCRIPT
Simple Buy/Sell Signals

The code works by continuously monitoring the relationship between two moving averages (MAs) on live price data — a fast MA (shorter period) and a slow MA (longer period). These MAs smooth out price action to help identify trends. Here's how it functions step-by-step:
Inputs: The user selects the MA type (SMA or EMA) and the lengths (periods) for the fast and slow MAs.
Calculation: The script calculates the chosen MAs using real-time closing prices.
Signal Logic: It detects a Buy signal when the fast MA crosses above the slow MA (crossover) and a Sell signal when the fast MA crosses below the slow MA (crossunder).
Plotting: When a signal occurs, the script plots a green "BUY" arrow below the candle or a red "SELL" arrow above it.
Alerts: It includes alert conditions so users can receive notifications when a buy or sell condition is met.
Inputs: The user selects the MA type (SMA or EMA) and the lengths (periods) for the fast and slow MAs.
Calculation: The script calculates the chosen MAs using real-time closing prices.
Signal Logic: It detects a Buy signal when the fast MA crosses above the slow MA (crossover) and a Sell signal when the fast MA crosses below the slow MA (crossunder).
Plotting: When a signal occurs, the script plots a green "BUY" arrow below the candle or a red "SELL" arrow above it.
Alerts: It includes alert conditions so users can receive notifications when a buy or sell condition is met.
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.