Dual Trend Confirmation Trading Strategy Based on Moving Averages and Outside Bar Pattern
Overview
This strategy is a trend following system that combines moving averages with Outside Bar pattern recognition. It utilizes 5-period and 9-period Exponential Moving Averages (EMA) as primary trend indicators, along with Outside Bar pattern for signal confirmation. The strategy includes dynamic stop-loss and take-profit settings based on Outside Bar height, as well as a position reversal mechanism triggered by stop-loss hits.
Strategy Principles
The core logic is based on the following key elements:
- Using 5-period and 9-period EMA crossovers to determine basic trend direction
- Confirming market volatility through Outside Bar pattern (current bar's high above previous bar's high and low below previous bar's low)
- Entering trades when EMA crossover signals coincide with Outside Bar patterns
- Using Outside Bar height to dynamically set stop-loss and take-profit levels, with take-profit at 50% and stop-loss at 100% of the bar height
- Automatically executing reverse positions when stop-loss is triggered to capture potential trend reversals
Strategy Advantages
- Dual confirmation mechanism improves trading accuracy by avoiding false signals from single indicators
- Dynamic stop-loss and take-profit settings better adapt to market volatility, maintaining reasonable risk management across different market conditions
- Position reversal mechanism quickly adapts to market trend changes, improving capital efficiency
- Strategy has clear entry and exit rules, making it easy to implement and backtest
Strategy Risks
- Outside Bar patterns may occur less frequently in low-volatility markets, affecting trading frequency
- Stop-loss positions may be too wide in rapidly volatile markets, increasing per-trade risk
- Position reversal mechanism may lead to consecutive losses in ranging markets
- Fixed EMA parameters may perform inconsistently across different market conditions
Optimization Directions
- Introduce volatility indicators to dynamically adjust stop-loss and take-profit ratios for more flexible risk management
- Consider adding trend strength filters to avoid trading in weak trend environments
- Optimize position reversal trigger conditions by incorporating market volatility indicators
- Research EMA parameter optimization across different timeframes to improve system adaptability
Summary
This is a strategy system that combines classical technical analysis with modern quantitative trading concepts. The combination of moving averages and Outside Bar patterns ensures both timely trend following and reliable signal generation. The design of dynamic stop-loss/take-profit and position reversal mechanisms demonstrates a strong focus on risk management, making the strategy practically viable. While there is room for optimization, the overall framework already meets basic conditions for live trading.
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-15 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy(title="Outside Bar EMA Crossover Strategy with EMA Shift", shorttitle="Outside Bar EMA Cross", overlay=true)
// Input for EMA lengths- 1

