Type/to search

BTC Trading Strategy Based on Moving Average Crossover

Cryptocurrency
Created: 2023-12-07 14:56:50
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This strategy is based on the golden cross and death cross signals of the 50-day moving average and the 200-day moving average of BTC, combined with additional technical indicators to generate buy and sell signals. This strategy is mainly suitable for currency pairs with obvious trend characteristics like BTC/USDT.

Strategy Principle

When the 50-day moving average crosses above the 200-day moving average to form a "golden cross", it indicates that BTC has entered a bull market and generates a buy signal. While when the 50-day moving average crosses below the 200-day moving average to form a "death cross", it indicates that BTC has entered a bear market and generates a sell signal.

In addition to the basic moving average "golden cross" and "death cross" signal judgment, this strategy also incorporates some additional technical indicators to assist in judgment, including:

  1. EMA indicator: Calculate an EMA indicator with length+offset, when it goes up indicates the current market is bullish, we can buy.

  2. Compare the value relationship between moving average and EMA: If EMA value is higher than 50-day moving average, a buy signal is generated.

  3. Check if the price has fallen more than 1% compared to the low of the previous K-line, if so generate a sell signal.

By combining the use of several indicators above, some wrong signals can be filtered out and the trading decisions of the strategy can be more reliable.

Advantage Analysis

This strategy has the following advantages:

  1. Using moving averages as the main trading signal can filter market noise and identify trend direction.

  2. Combining with multiple auxiliary technical indicators can enhance signal reliability and filter out false signals.

  3. Adopting appropriate stop-loss strategies can effectively control single loss.

  4. The relatively simple trading logic is easy to understand and implement, suitable for beginners of quantitative trading.

  5. There are many configurable parameters that can be adjusted according to your own preferences.

Risk Analysis

This strategy also has some risks to note:

  1. The moving average itself has a strong lagging attribute, possibly missing opportunities for rapid price reversal.

  2. Adding assistant indicators increases the number of rules and also increases the probability of generating wrong signals.

  3. Improper stop-loss settings may lead to enlarged losses.

  4. Inappropriate parameter settings (such as moving average length, etc.) will also affect strategy results.

The corresponding solutions:

  1. Appropriately shorten the moving average cycle and increase the parameter optimization range.

  2. Increase backtest data quantity to check signal quality.

  3. Properly relax the stop loss range while setting take profit stops.

  4. Increase parameter optimization to find the best parameter combinations.

Optimization Directions

This strategy can also be optimized in the following directions:

  1. Increase machine learning algorithms to achieve automatic parameter optimization.

  2. Add more auxiliary indicators to build multiple sub-strategies and make decisions through a voting mechanism.

  3. Try breakout strategies to identify price breakthroughs.

  4. Use deep learning to predict price trends.

  5. Optimize stop-loss mechanisms to achieve dynamic tracking stop-loss.

The above optimizations can improve decision accuracy and enhance the profitability and stability of the strategy.

Summary

This strategy mainly makes trading decisions based on the moving average crossover of BTC, assisted by technical indicators such as EMA to filter signals. The strategy has strong trend-following capability and high configurability, making it suitable as a beginner's quantitative trading strategy. But there are also certain lagging risks that need to be guarded against. The next optimization directions can be from multiple dimensions such as machine learning, portfolio strategies, stop-loss strategies, etc.

Source
Pine
/*backtest
start: 2023-11-06 00:00:00
end: 2023-12-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy('JayJay BTC Signal', overlay=true, initial_capital=100, currency='USD', default_qty_value=100, default_qty_type=strategy.percent_of_equity, commission_value=0, calc_on_every_tick=true)

securityNoRepaint(sym, tf, src) => request.security(sym, tf, src[barstate.isrealtime ? 1 : 0])[barstate.isrealtime ? 0 : 1]
Strategy parameters
Strategy parameters
MA50-Length
MA50-Source
Show SMA50 on chart
MA200-Length
MA200-Source
Show SMA200 on chart
EMA Offset
Show EMA on chart
ema Length
StartFrom
EMA Options
Ma50 Timeframe
Ma200 Timeframe
EMA 1 Timeframe
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)