Type/to search

Multi-Timeframe Moving Average Crossover Optimization Strategy

Common strategy
Created: 2024-01-05 12:05:42
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy is based on the famous CM_Ultimate_MA_MTF indicator and rewritten into a trading strategy. It can plot moving averages across multiple timeframes and generate crossover signals between MAs of different periods. The strategy also incorporates a trailing stop loss mechanism.

Strategy Logic

  1. Plot MA lines of different types on the main chart timeframe and higher timeframes based on user configuration.
  2. Go long when faster MA crosses above slower MA; go short when faster MA crosses below slower MA.
  3. Add trailing stop loss to further control risks.

Advantage Analysis

  1. MA crossovers across timeframes can improve signal quality and reduce false signals.
  2. Combination of different MA types utilizes strengths of individual indicators for better stability.
  3. Trailing stop loss helps to limit losses in a timely manner.

Risk Analysis

  1. Lagging nature of MA may miss short-term opportunities.
  2. Poor optimization of MA periods may generate excessive false signals.
  3. Improper stop loss placement may cause unnecessary exit.

Optimization Directions

  1. Test combinations of MA parameters to find optimum setup.
  2. Add other indicators for signal filtration and quality improvement.
  3. Optimize stop loss strategy to suit market profile.

Conclusion

The strategy integrates multi-timeframe analysis and trailing stop approaches of moving averages to improve signal quality and risk control. Further enhancement can be achieved through parameter tuning and adding complementary indicators.

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

//@version=2

strategy(title = "Ultimate Moving Average Strategy", shorttitle = "UMA Strategy", overlay = true)
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
Use Trailing Stop?
Stop Loss Trail Points
Stop Loss Trail Offset
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)