Moving Average Crossover Multi Timeframe Strategy
Overview
This strategy is based on moving average crossover system, using golden cross and death cross of moving averages in different timeframes to determine entry and exit points. It also combines features like trailing stop loss, take profit and stop loss to lock in profits and mitigate risks.
Strategy Logic
The strategy utilizes two sets of moving averages, fast MA and slow MA. The fast MA has a shorter period to capture short-term trend, while the slow MA has a longer period for long-term trend. When the fast MA crosses above the slow MA, a golden cross occurs, signaling an uptrend. When the fast MA crosses below the slow MA, a death cross occurs, signaling a downtrend.
In the code, the fast MA is ma1, slow MA is ma2. Both ma1 and ma2 can be different types like SMA, EMA, with customizable periods. ma1 represents short-term trend with shorter period, ma2 represents long-term trend with longer period.
When ma1 golden crosses ma2, a long signal is generated. When ma1 death crosses ma2, a short signal is generated. In actual trading, features like trailing stop loss, take profit and stop loss can be added to lock in profits and control risks.
Advantage Analysis
The strategy has the following advantages:
-
Simple and easy-to-understand logic.
-
Flexible in choosing different types and parameters of MAs for different market conditions.
-
Multi-timeframe design to capture both short and long term trends.
-
Customizable entry rules to strictly control trading frequency.
-
Configurable stop loss and take profit to effectively manage risks.
-
Trend trailing stop loss allows profit to run.
-
Optimizable parameters for more robustness.
Risk Analysis
The strategy also has the following risks:
-
Lagging issue of dual MA crossovers may miss best reversal timing.
-
Improper MA periods may generate more false signals.
-
Sudden reversals may hit stop loss.
-
Price may stay on one side of MA for extended periods in trending markets.
-
Over-optimization over fitted parameters.
Risk management measures:
-
Add filters to avoid false breakout signals.
-
Test and optimize MA periods based on trading principles.
-
Careful risk control and reasonable stop loss placement.
-
Accept necessary cost of patience.
-
Robustness test under different market conditions.
Optimization Directions
The strategy can be improved from the following aspects:
-
Test more types of MA, like weighted moving average.
-
Add dynamic periods based on volatility.
-
Add filters like time and fundamentals to entry rules.
-
Use adaptive stops that adjust to market volatility.
-
Build parameter optimization system for backtesting.
-
Incorporate machine learning to optimize parameters and filter signals.
Conclusion
In conclusion, this moving average crossover multi timeframe strategy has simple and clear logic to follow trends using fast and slow MA crossovers. With proper parameter selection, optimized entry/exit rules and risk control, it can achieve steady profits. However, users need to tolerate lagging risks and waiting time costs. Overall it is a simple, practical strategy worth optimizing and risk control for adapting to more market conditions.
/*backtest
start: 2023-09-08 00:00:00
end: 2023-10-08 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
// The majority of this script I took from the Autoview website. There are some typos in the original that I've fixed, some things I've added, things I will add, and I'm tired pulling my strategy code out and uploading this to pastebin for people.
// DISCLAIMER: I am not a financial advisor, this is not financial advice, do not use this code without first doing your own research, etc, etc, it's not my fault when you lose your house.
- 1
