Type/to search

MZ MA Cross Multiple TimeFrame Strategy

Common strategy
Created: 2023-11-16 17:28:43
Last modified: 3 years ago
1
Follow
1802
Followers

img

This strategy mainly uses MA line crossovers across multiple timeframes to determine trend direction, and trades long or short when the trend is clear after filtering signals with specific criteria. It belongs to the trend following strategy category.

Strategy Logic

  1. User inputs custom backtest time range.

  2. Choose to use Heikin-Ashi candles or normal candles.

  3. Define slow, fast and optional third MA line for uptrends.

  4. Customize MA type, timeframe and parameters for each MA line.

  5. Long signal when fast MA crosses above slow MA, short signal when crossing below.

  6. Optional to only long when close is above the third MA line.

  7. Use strategy.entry for automated trading.

  8. Fixed trade size or calculate based on account percentage.

Advantages

  1. Uses MTF structure, each MA has own timeframe to identify trends across timescales.

  2. Customizable MA types, can use Smooth MAs for stability or Fast MAs for responsiveness.

  3. Heikin-Ashi filters false breakouts.

  4. Optional third MA line filters whipsaws.

  5. Flexible MA periods suit different market environments.

  6. strategy.entry module automates trading.

  7. Backtest optimization finds best parameters.

Risks

  1. MA crosses prone to false signals, causing unnecessary trades. Can optimize periods or add filters.

  2. Whipsaws cause losses in choppy markets. Can widen MA spacing or lengthen periods.

  3. Fixed trade size doesn't control risk. Consider percentage of account size.

  4. Fees and slippage also impact profitability. Ensure high enough win rate.

Optimization

  1. Test different MA types for best combinations of stability and responsiveness.

  2. Optimize MA periods to balance trend identification and sensitivity.

  3. Refine entry conditions, consider stronger uptrend filters.

  4. Optimize periods for specific products.

  5. Add other indicators as filters, e.g. volume.

  6. Parameter optimization on backtest data to maximize performance.

Conclusion

The MTF MA crossover strategy is a common trend following system. Benefits include simplicity, flexibility and adaptability. But false signals remain a risk. Parameters and filters can be optimized via backtesting to find best combinations. More suitable for trending markets. Use cautiously or stop trading during choppy conditions. As a traditional trend following technique, MTF MA crossovers are still worth dedicated research and application.

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

//@version=4
strategy(shorttitle="MZ MA Cross",title="MA MTF Cross Strategy", overlay=true, calc_on_order_fills=false, calc_on_every_tick=false, default_qty_type=strategy.fixed, default_qty_value=5,commission_value=0.1)

timeFrameticker  = input('D',type=input.resolution, title="Chart Timeframe")
Strategy parameters
Strategy parameters
Chart Timeframe
Use Heikin Ashi Candles
From Month
From Day
From Year
Thru Month
Thru Day
Thru Year
Show Date Range
Slow MA Type
Fast MA Type
Use Uptrend Conditional 3rd MA for Confirmation
Uptrend Conditional MA Type
Slow MA Resolution
Fast MA Resolution
Uptrend Conditional MA Resolution
Slow MA Length
Fast MA Length
Uptrend Conditional MA Length
Kijun MOD Divider
* Jurik (JMA) Only - Phase
* Jurik (JMA) Only - Power
* Volatility Adjusted (VAMA) Only - Volatility lookback length
Modular Filter, General Filter Only - Beta
Modular Filter Only - Feedback
Modular Filter Only - Feedback Weighting
EDSMA - Super Smoother Filter Length
EDSMA - Super Smoother Filter Poles
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)