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

Skrypt open-source

W prawdziwym duchu TradingView autor tego skryptu opublikował go jako open source, aby inwestorzy mogli go zrozumieć i zweryfikować. Pozdrowienia dla autora! Możesz go używać bezpłatnie, ale ponowne użycie tego kodu w publikacji podlega Zasadom Regulaminu. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Chcesz użyć tego skryptu na wykresie?

Wyłączenie odpowiedzialności