« Back home

Death Cross & Golden Cross

The Death cross and the Golden cross are fairly simple strategies, it derives its significance mainly due to the fact that the asset’s price averages have crossed a significant physiological moving average level.

The crossover involves the asset’s 200 day simple moving average and 50 day simple moving average crossover.

Buy script

Sell script

Additional notes

Traders can replace 200 and 50 with any other number to identify the respective crossover. For example in the above code if you replace 200 and 50 with 21 and 9 then it becomes a simple 21 x 9 day SMA crossover