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

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明