Type/to search

Golden Cross Uptrend Tracking Strategy

Common strategy
Created: 2024-01-03 11:46:44
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy is designed based on the golden cross principle of moving averages. Specifically, it uses two simple moving averages of different periods, namely the 50-period line and the 200-period line. When the 50-period line breaks through the 200-period line from below, a buy signal is generated. When the 50-period line breaks through the 200-period line from above, a sell signal is generated.

Strategy Logic

The strategy is written in Pine Script language, with main logic as follows:

  1. Calculate two SMAs: 50-period SMA and 200-period SMA
  2. Determine golden cross: when 50-period SMA crosses above 200-period SMA, go long
  3. Determine death cross: when 50-period SMA crosses below 200-period SMA, close position

The importance of using SMA indicator here is that it can effectively filter out market noise and capture long-term trends. When faster SMA line crosses above slower SMA line, it indicates the short-term uptrend momentum defeats the long-term downtrend, generating a buy signal.

Advantages

The strategy has the following advantages:

  1. Simple and easy-to-understand principle, easy to implement.
  2. Reasonable PARAMETERS settings, customizable two SMA periods, adaptable to different markets.
  3. Written in stable Pine language version, runs efficiently.
  4. Rich visual settings, easy to use.

Risks and Solutions

The strategy also has some risks:

  1. False breakout may occur, generating wrong signals. Can adjust two SMA parameters to reduce false breakout probability.

  2. Cannot respond to short-term market, only suitable for long-term investors. Can appropriately shorten fast SMA period.

  3. Drawdown may be large. Can set stop loss, or properly adjust position management.

Optimization Directions

The strategy can be further optimized in following aspects:

  1. Add other indicators for filtering, combining multiple buy/sell conditions to reduce false signals.

  2. Add stop loss mechanism. Mandatory stop loss when price breaks certain level.

  3. Optimize position management. Such as pyramiding along the trend, trailing stop loss etc. To control drawdown and pursue higher return.

  4. Parameter optimization. Evaluate the impact of different parameters on return/risk ratio.

Conclusion

In general, this is a typical trend tracking strategy. It utilizes the advantage of SMA to simply and efficiently capture long-term trends. Can customize based on one's style and tuning space. Also need to notice existing deficiencies for further optimization and improvement.

Source
Pine
/*backtest
start: 2023-12-26 00:00:00
end: 2024-01-02 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// @version=4
//
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// www.tradingview.com/u/TradeFab/
Strategy parameters
Strategy parameters
Fast SMA Period
Slow SMA Period
Backtest Start Year
Backtest Start Month
Backtest Start Day
Backtest Stop Year
Backtest Stop Month
Backtest Stop Day
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)