GoldenCrossBreakouts

Description

The Golden Cross Breakouts strategy is a moving average-based technical indicator proposed by Ken Calhoun. Designed for swing trading purposes, it calculates two moving averages of the close price and adds simulated orders based on their crossovers. The name of this strategy refers to the popular "golden cross" breakout pattern, an event where a security's shorter moving average crosses above the long-term one.   

By default, the strategy adds a simulated buy order when the 50-period simple moving average of the close price crosses above the 200-period one. A simulated sell order is added when the price breaks below the 50-period moving average. Alternatively, a trailing stop can be used for exits, e.g., the TrailingStopLX.

Note that you can also customize this strategy by changing moving average types and lengths in the input parameters. 

Input Parameters

fast length Defines the length of the fast moving average; it must be less than the slow moving average length.
slow length Defines the length of the slow moving average; it must be greater than the fast moving average length.
average type The type of moving average to be used in calculations: simple, exponential, weighted, Wilder's, or Hull.

Plots

FastMA The fast moving average plot.
SlowMA The slow moving average plot.

Further Reading

1. "Golden Cross Breakouts" by Ken Calhoun. Technical Analysis of Stocks & Commodities, March 2017.