Golden Cross Documentation [EN]

CautionThe documentation is currently being written. It will be completed in the coming days.


The Golden Cross indicator will help you trade the moving average crossings. It detects crossings and breakouts of 14 different moving averages. The indicator displays buy and sell signals on the chart, with their price targets and safety stops. The screener will help you to seize trade opportunities in real-time.

Indicator Installation

Before installing the Golden Cross indicator, you must purchase a license or subscribe to the trial version. The indicator is available on the Prorealcode marketplace at this address:

https://market.prorealcode.com/product/golden-cross-indicator-screener

Installing the Golden Cross indicator is quick and easy. Simply follow the standard installation procedure described on this page:

https://market.prorealcode.com/comment-installer-mon-produit-dans-prorealtime

Launching the Indicator

After installing the license on your Prorealtime platform, the indicator will be available in the Indicators & Trading Systems window in the “ProRealCode MarketPlace” section.

To access the indicators window, click on the “Price” icon located in the price chart window, then on “Add Indicator…“:

Add Indicator Prorealtime

To access the indicator, refer to the “ProRealCode MarketPlace” section or type the name “Golden Cross” in the search bar. Double-click on the “Golden Cross” indicator to display it in the price window.

Why does the price chart become flattened after loading the indicator?

The indicator returns buy and sell signals. This allows you to use the indicator to create alerts and backtests. It returns 1 for buy signals and -1 for sell signals.

These values ​​are displayed by default on the price chart. This automatically adjusts the chart size, making it flattened.

To avoid having to readjust the price chart, follow these steps:

  • Open the indicator configuration window
  • Scroll to the bottom of the window
  • Uncheck the box corresponding to the signal (which can be named “Signal”, “Breakout”, “Crossing”, etc.)

If the problem persists, you can uncheck the stoploss and targets. The indicator already displays these.

Indicator Configuration

The Golden Cross indicator is fully configurable. You can choose to display the moving average(s) of your choice, select the signal types, apply filters, set the price target level, and customize the display.

Access the Control Panel

To access the indicator’s control panel, click on the indicator tab at the top of the price chart window, then click “Configure“:

Golden Cross Setting

The indicator’s control window will open, allowing you to configure it according to your preferences:

Golden Cross Indicator Setting Panel

Selecting the Crossover Type

The indicator detects the moving average crossings. A crossover indicates a buy signal, and a crossunder indicates a short-sell signal.

You can choose the type of crossover the indicator will detect by checking the corresponding box(es):

Golden Cross Indicator Setting Crossings

Moving Average Breakouts

The Golden Cross indicator can detect bullish and bearish breakouts of moving averages. You must set a period from 1 to the first moving average to activate this signal.

Moving Average Periods

You can set the period of the moving averages whose crossings the indicator will detect. A Golden Cross corresponds to a bullish crossover of a 200-period moving average with a 50-period moving average. A Death Cross corresponds to a crossunder of these moving averages.

The Golden Cross indicator allows you to set the period of these two moving averages. Simply define the periods you have chosen in the “MA 1 Length” and “MA 2 Length” boxes:

Golden Cross Indicator Setting MA Periods

Moving Averages Selector

The Golden Cross indicator knows 14 moving averages. You can select the one(s) of your choice by checking the corresponding boxes:

Golden Cross Indicator Setting MA Selector

Trend Filters

You can filter buy and sell signals based on the trend of the moving averages. To do this, check the corresponding box(es):

Golden Cross Indicator Setting Trend Filter

Volume and Strength Filters

You can filter buy and sell signals based on volume and market strength. Check the “with Volume” box to filter signals accompanied by volume and the “with Strength” box to filter signals based on market strength:

Golden Cross Indicator Setting Volume Strength Filters

Price Targets and Safety Stops

The Golden Cross indicator automatically calculates the position of price targets and safety stops based on market conditions. You can display them by checking the “Take Profit” and “Stop-Loss” boxes. You can also determine their levels by entering the “TP Level” and “SL Level” boxes:

Golden Cross Indicator Setting Target Stoploss

Display Options

The Golden Cross indicator offers two display options. You can choose to display moving averages by checking the “Display MA” box. You can set the thickness of the moving averages with the “MA Thickness” parameter:

Golden Cross Indicator Setting Display

Creating an Alert System

The Prorealtime platform allows you to create trading alerts. You can create alerts from the Golden Cross indicator for moving average crossings and breakouts.

Here are the steps you need to follow to create an alert:

1. Configure the Indicator

Before creating an alert, you must configure the Golden Cross indicator. The Prorealtime platform will use your indicator’s configuration to send you alerts.

If you have selected cross-over for 50- and 200-period simple moving averages, the Prorealtime platform will only send you alerts for this configuration.

In this example, I will create an alert for a 50-period simple moving average crossing over the 200-period moving average on the Nasdaq ETF (QQQ).

2. Open the Alerts Window

To set up an alert, you must open the alerts window. To do this, right-click on the price chart and click “Create New Alert.” This will open the following window:

Golden Cross Indicator Prorealtime Alert

3. Select the Golden Cross indicator

You must select the Golden Cross indicator so that the Prorealtime alert system uses the signals returned by this indicator:

Golden Cross Indicator Prorealtime Alert Indicator Selection

4. Set the values

The Golden Cross indicator returns 1 when there is a cross-over and -1 when there is a cross-under. (Make sure you have checked the “Cross Over” and/or “Cross Under” boxes before creating the alert.)

  • To create an alert on cross-over, select the “equals” sign and set the value to “1“.
  • To create an alert for cross-under, select the “equals” sign and enter a value of “-1“.

This example involves creating an alert for cross-overs, so you must enter a value of 1:

Golden Cross Indicator Prorealtime Alert Signal

5. Managing Triggers

The trigger section allows you to choose the alert timing. In this example, the platform will send alerts once a day in the event of a moving average cross-over:

Golden Cross Indicator Prorealtime Alert Properties

6. Creating the Alert

After checking your alert settings, click the “Create Alert” button:

Golden Cross Indicator Prorealtime Alert Running

Note: You can write a message describing the signal in the comment box.

Backtesting a Strategy

You can integrate the indicator into a backtest to test a configuration. To do this, you must use the “CALL” function:

myCrossing, myTargetLong, myStopLossLong, myTargetShort, myStopLossShort = CALL "Golden Cross"[1, 0, 50, 200, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 1, 2](close)

Calling the Indicator in a Backtest

To call the indicator in a backtest, you must pass its configuration parameters to it. I have created an example code to help you integrate the indicator into a strategy. The variable names are the same as those of the indicator.

The following code calls the Golden Cross indicator. It will open long positions after a 50-period simple moving average crosses over a 200-period moving average:

//--------------------------------------------------------//
// *** Stock Breakout Backtest  *** //
//--------------------------------------------------------//
// Author: Vivien Schmitt
// Website: https://artificall.com
// Indicator: Golden Cross
// Description: https://artificall.com/golden-cross/
// Marketplace: https://market.prorealcode.com/product/golden-cross-indicator-screener/
//--------------------------------------------------------//

DEFPARAM CUMULATEORDERS = False
DEFPARAM PRELOADBARS = 1000

//--------------------------------------------------------//
// *** POSITION SIZE *** //
//--------------------------------------------------------//
// Capital to invest
ONCE CapitalToInvest = 10000
// Minimum number of contracts
ONCE NumberOfContractsMin = 1
// Position Size
NumberOfContracts = MAX(ROUND(CapitalToInvest / Close, 2), NumberOfContractsMin)

//--------------------------------------------------------//
// *** SETTING BLOCK *** //
//--------------------------------------------------------//

// * Type of Crossings
ONCE isCrossOver = 1
ONCE isCrossUnder = 0

// * Moving average length
ONCE ma1Length = 50
ONCE ma2Length = 200

// * Moving Averages
// Simple Moving Average
ONCE isSMA = 0
// Exponential Moving Average
ONCE isEMA = 0
// Double Exponential Moving Average
ONCE isDEMA = 0
// Triple Exponential Moving Average
ONCE isTEMA = 0
// Weighted Moving Average
ONCE isWMA = 0
// Kaufman Adaptive Moving Average
ONCE isAMA = 0
// Hull Moving Average
ONCE isHMA = 1
// Triangular Moving Average
ONCE isTMA = 0
// Wilder Moving Average
ONCE isWILDMA = 0
// Zero Lag Exponential Moving Average
ONCE isZLEMA = 0
// Least Square Moving Average
ONCE isLSMA = 0
// Time Series Moving Average
ONCE isTSMA = 0
// Volume-Weighted Moving Average
ONCE isVWMA = 0
// Period Volume-Weighted Moving Average
ONCE isEVWMA = 0

// * Filters
ONCE isMaPositive1 = 0
ONCE isMaNegative1 = 0
ONCE isMaPositive2 = 0
ONCE isMaNegative2 = 0
ONCE isWithVolume = 0
ONCE isWithStrength = 0

// * Others
ONCE isTakeProfit = 1
ONCE TPLevel = 4
ONCE isStoploss = 1
ONCE SLLevel = 0
ONCE isDisplay = 0
ONCE maThickness = 0

//--------------------------------------------------------//
// * INDICATOR CALLING * //
//--------------------------------------------------------//
myCrossing, myTargetLong, myStopLossLong, myTargetShort, myStopLossShort = CALL "Golden Cross"[isCrossOver, isCrossUnder, ma1Length, ma2Length, isSMA, isEMA, isDEMA, isTEMA, isWMA, isAMA, isHMA, isTMA, isWILDMA, isZLEMA, isLSMA, isTSMA, isVWMA, isEVWMA, isMaPositive1, isMaNegative1, isMaPositive2, isMaNegative2, isWithVolume, isWithStrength, isTakeProfit, TPLevel, isStoploss, SLLevel, isDisplay, maThickness](close)

//myCrossing, myTargetLong, myStopLossLong, myTargetShort, myStopLossShort = CALL "Golden Cross"[1, 0, 50, 200, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 1, 2](close)

//--------------------------------------------------------//
// * Buying Conditions * //
//--------------------------------------------------------//
IF NOT OnMarket AND myCrossing = 1 THEN
  // Target price
  Set Target Price myTargetLong
  // Stop-Loss price
  Set Stop Price myStoplossLong
  // Buying order
  BUY NumberOfContracts CONTRACTS AT MARKET
ENDIF

//--------------------------------------------------------//
// * Short-selling conditions * //
//--------------------------------------------------------//
IF NOT OnMarket AND myCrossing = -1 THEN
  // Target price
  Set Target Price myTargetShort
  // Stop-Loss price
  Set Stop Price myStoplossShort
  // Buying order
  SELLSHORT NumberOfContracts CONTRACTS AT MARKET
ENDIF

Golden Cross Screener

The Golden Cross market scanner lets you identify real-time opportunities for moving average crossings and breakouts. You can apply it to predefined or custom lists. You can apply it to all asset classes in all time frames.

Screener Installation

The screener installation procedure is identical to that of the indicator. You will receive a specific license number for the screener that you will need to add to your platform. After installation, you will find the screener in the ProScreener window of the Prorealtime platform.

To access the screener, follow these steps:

Open the ProScreener Window

You can open the ProScreener window by clicking “View” then ProScreener, or by using the shortcut “Ctrl-E“:

ProScreener Open Window
Fenêtre ProScreener

Open the Screener Management Window

Click the “Create or Modify a Screener” wrench in the ProScreener window:

ProScreener Window Create modify Golden Cross Screener

Select the Golden Cross Screener

Click the “Golden Cross Scan” screener located in the screener list:

Golden Cross Screener Global Setting Window

Screener Configuration

The screener settings are the same as those for the indicator, except for the display options that are not relevant to the scanner’s operation:

Golden Cross Screener Setting MA Selector

Crossing Type

You can search for rising and falling crossovers by checking the “CrossOver” and “CrossUnder” boxes:

Golden Cross Screener Setting Signals

Moving Average Length

You can set the moving average periods by filling in the “MaLength1” and “MaLength2” boxes:

Golden Cross Screener Setting Periods

Moving Average Selection

You can select the moving average(s) of your choice by checking the appropriate boxes:

Golden Cross Screener Setting MA Selector

Trend Filters

You can filter signals based on the moving average trend:

Golden Cross Screener Setting Trend Filters

Volume and Strength Filters

You can filter signals based on market volume and strength:

Golden Cross Screener Setting Volume Strength Filters

Timeframe and Asset List

The selection of timeframes and asset list is located in the “ProScreener Management” window.

Choosing the Timeframe

You can choose the timeframe in which the screener will search for opportunities:

Golden Cross Screener Setting Timeframe

Select an Asset List

You must select a list in which you want to search for opportunities:

Golden Cross Screener Setting Asset List

Run the Screener

You can now launch the screener by clicking the “Run ProScreener” button:

Golden Cross Screener Run

Screener Results

After launching the screener, the discovered opportunities will appear in the results list. Simply click on a line to display it on the price chart:

Golden Cross Screener Result

Increase the Number of Opportunities

If the screener does not return enough results, it means that no stock matches your configuration. Here are some actions you can take to increase the number of opportunities found by the screener:

  • Reduce the length of moving averages
  • Disable volume and strength filters
  • Choose large asset lists like the Nasdaq and NYSE
  • Choose a shorter timeframe