OPEN-SOURCE SCRIPT

Golden Cross Detector

This Pine Script™ identifies and visualizes a Golden Cross on a chart using two Simple Moving Averages (SMA) of different periods. A Golden Cross is a bullish signal that occurs when a shorter-term moving average crosses above a longer-term moving average.

Script Description
Indicator Name:

The script is titled "Golden Cross Detector" and overlays the chart.
Moving Averages:

A 50-period SMA (short-term) is calculated using the ta.sma() function.
A 200-period SMA (long-term) is also calculated.
The 50 SMA and 200 SMA are plotted as lines:
50 SMA: Blue line.
200 SMA: Red line.
Golden Cross Detection:

The script checks for a "Golden Cross" using the ta.crossover() function.
A Golden Cross occurs when the 50-period SMA (short-term) crosses above the 200-period SMA (long-term).
Visual Representation:

When a Golden Cross is detected, a green triangle marker is plotted below the bar where the crossover happens.
The triangle is labeled "Golden Cross" to make it easy to identify.
Key Features:
Simplicity: The script focuses solely on detecting and highlighting Golden Cross events.
Customizable: You can adjust the SMA lengths (50 and 200) for different strategies.
Visual Clarity: The two SMAs (blue and red) and the green marker clearly display the crossover signal.
Chart patterns

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항