Type/to search

Cross Moving Average Reversal Strategy

Common strategy
Created: 2024-02-20 13:59:46
Last modified: 2 years ago
1
Follow
1802
Followers

img

Overview

This is a reversal strategy based on simple moving average crossover. It uses 1-day and 5-day simple moving averages. When the shorter SMA crosses above the longer SMA, it goes long. When the shorter SMA crosses below the longer SMA, it goes short. It's a typical trend following strategy.

Strategy Logic

The strategy calculates the 1-day SMA (sma1) and 5-day SMA (sma5) of the closing price. When sma1 crosses over sma5, it enters a long position. When sma1 crosses below sma5, it enters a short position. After opening a long position, the stop loss is set at 5 USD below the entry price and take profit at 150 USD above. For short positions, stop loss is 5 USD above entry and take profit 150 USD below.

Advantage Analysis

  • Using double SMAs to determine market trend, avoiding loss trades after stop loss
  • SMA parameters simple and reasonable, good backtest results
  • Small stop loss to withstand certain price fluctuations
  • Big profit target to make enough money

Risk Analysis

  • Double SMAs are prone to whipsaws, high probability of stop loss when choppy
  • Hard to catch trending moves, limited profit for long term trades
  • Limited optimization space, easy to overfit
  • Parameters need adjustment for different trading instruments

Improvement Directions

  • Add other filters to avoid wrong signals
  • Dynamic stop loss and take profit
  • Optimize SMA parameters
  • Combine volatility index to control position sizing

Conclusion

This simple double SMA strategy is easy to understand and implement for fast strategy verification. But it has limited risk tolerance and profit potential. Further optimizations are needed in parameters and filters to adapt more market conditions. As a starter quant strategy, it contains basic building blocks for iterable improvements.

Source
Pine
/*backtest
start: 2023-02-19 00:00:00
end: 2024-02-19 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Valeria 181 Bot Strategy Mejorado 2.21", overlay=true, margin_long=100, margin_short=100)
 
var float lastLongOrderPrice = na
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)