Type/to search

Moving Average Cross Signal Strategy

Common strategy
Created: 2024-01-08 15:54:32
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy calculates and plots different types of moving averages to implement moving average cross signals for generating buy and sell signals.

Strategy Principle

  1. The strategy allows the selection of different types of moving averages, including SMA, EMA, WMA, etc.
  2. The strategy calculates the main moving average and also allows the selection of a second moving average.
  3. Judge the market trend based on the cross situation between the main moving average and the second moving average.
  4. When the main moving average crosses above its own specified cycle moving average, a buy signal is generated; When the main moving average falls below its own specified cycle moving average, a sell signal is generated.
  5. Thus, by the cross situation of the moving averages, the market trend can be judged more clearly.

Advantages of the Strategy

  1. Customizable types of moving averages to meet different needs.
  2. Add a second moving average for clearer signals.
  3. Customizable cycles of moving averages, suitable for different time cycles.
  4. Smooth color rendering for clearer graphs.
  5. Uses a cross signal mechanism for accurate judgment of trends.

Risks & Optimization of the Strategy

  1. Moving averages have lagging properties, false signals may occur. Curve fitting moving averages can be used appropriately.
  2. Improper setting of moving average cycles may lead to missed trading opportunities. More combinations can be tested to find optimal parameters.
  3. It is recommended to use other indicators such as trading volume energy for verification to reduce risks.
  4. Consider changing the signal moving average to curl average to improve signal accuracy.
  5. Models like LSTM can be used to optimize the strategy.

Conclusion

The overall idea of ​​the strategy is clear, using the principle of moving average cross to judge market trend, customizable parameters to meet different needs. There are also some problems, but they can be improved by optimizing models and parameters. Overall, this strategy is a typical representative of trading strategies based on moving averages.

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

//@version=3
strategy("Moving averages-Strategy", overlay=true)
//Created by user ChrisMoody 4-24-2014
//Plots The Majority of Moving Averages
Strategy parameters
Strategy parameters
Use Current Chart Resolution?
Use Different Timeframe? Uncheck Box Above
Moving Average Length - LookBack Period
1=SMA, 2=EMA, 3=WMA, 4=HullMA, 5=VWMA, 6=RMA, 7=TEMA
Change Color Based On Direction?
Color Smoothing - 1 = No Smoothing
Optional 2nd Moving Average
Moving Average Length - Optional 2nd MA
1=SMA, 2=EMA, 3=WMA, 4=HullMA, 5=VWMA, 6=RMA, 7=TEMA
Change Color Based On Direction 2nd MA?
***You Can Turn On The Show Dots Parameter Below Without Plotting 2nd MA to See Crosses***
***If Using Cross Feature W/O Plotting 2ndMA - Make Sure 2ndMA Parameters are Set Correctly***
Show Dots on Cross of Both MA's
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)