OPEN-SOURCE SCRIPT

SMA Crossover Signals

This Script is designed to identify and visually highlight trading signals based on the crossover of two simple moving averages (SMAs) and the relationship between the price and a third SMA. Here's what the script does:

Simple Moving Averages:

Calculates three SMAs:
8-period SMA (sma8): Short-term moving average.
20-period SMA (sma20): Mid-term moving average.
50-period SMA (sma50): Used to determine the overall trend.
Signal Generation:

Buy Signal: A "BUY SIGNAL" is generated and labeled when:
The 8 SMA crosses above the 20 SMA.
The closing price is above the 50 SMA (indicating an uptrend).
Sell Signal: A "SELL SIGNAL" is generated and labeled when:
The 8 SMA crosses below the 20 SMA.
The closing price is below the 50 SMA (indicating a downtrend).
Visual Elements:

SMA Plots:
The 8 SMA is plotted in blue.
The 20 SMA is plotted in red.
Labels:
"BUY SIGNAL" labels are placed above the high of the corresponding bar, in green, with reduced font size.
"SELL SIGNAL" labels are placed below the low of the corresponding bar, in red, with reduced font size.
Background Coloring:
The background is shaded green when the price is above the 50 SMA.
The background is shaded red when the price is below the 50 SMA.
Purpose:

This script is intended to help traders quickly identify buy and sell opportunities based on moving average crossovers and the trend as defined by the 50 SMA. The visual cues make it easier to see the current trend and possible entry or exit points.
This script can be applied to any chart on TradingView to analyze the market conditions and assist in making trading decisions.
Chart patternsMoving AveragesTrend Analysis

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad