Dual Direction Price Breakthrough Moving Average Timing Trading Strategy
Overview
The Dual Direction Price Breakthrough Moving Average Timing Trading Strategy is a quantitative trading strategy that uses price breakthrough of moving averages to determine trading signals. It compares price with moving averages of specified periods and generates trading signals when price breaks through moving averages.
Strategy Logic
The core logic of this strategy is:
-
Calculate moving averages (EMA) of specified period (e.g. 200 days) using EMA function.
-
Compare close price with EMA to determine if price breaks through EMA. Specifically, when close price is above EMA, price breaks up through EMA; when close price is below EMA, price breaks down through EMA.
-
Determine long and short signals based on breakthroughs. When price breaks up through EMA, generate long signal; when price breaks down through EMA, generate short signal.
-
When signal is triggered, place order with certain percentage (e.g. 100%) and set stop loss and take profit prices.
-
When stop loss or take profit price is touched, close position.
-
Repeat the process to profit from timing of price breaking through moving averages.
The strategy is simple and straightforward to understand and implement. It aims to capture short-term momentum by signals of breaking through moving averages. But it also has certain lagging and whipsaw risks.
Advantages
- Simple and clear logic, easy to understand and validate.
- Smooth tracking ability utilizing characteristics of moving averages.
- High trading frequency, suitable for short-term trading.
- Quick response to price change, catching good timing.
Risks
- Certain level of lagging, may miss initial breakthrough of price.
- Frequent trading when whipsawed multiple times.
- Risk of being stopped out on sharp reversals.
Optimization methods include parameter tuning, using more effective indicators, reducing trading frequency etc. Adaptive stops and filtering conditions can also control risks.
Optimization Directions
- Test different types and parameters of moving averages for better solution, e.g. EMA, SMA, LWMA.
- Add filtering conditions to avoid whipsaw trades, e.g. volume, Bollinger Bands, ATR etc.
- Optimize and test stop loss and take profit strategies to lower risks.
- Combine trend following, mean reversion and other strategies for robust trading system.
- Add parametrization for wider adaptability.
Conclusion
The strategy has relatively simple logic of tracking moving averages to capture short-term momentum. Advantages include responsiveness and ease of use; disadvantages include lagging and inertia. Further optimizations can be done on indicator selection, stop loss mechanisms, filtering techniques to make the strategy more solid and comprehensive.
/*backtest
start: 2022-12-08 00:00:00
end: 2023-12-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Credits to the original Script - Range Filter DonovanWall https://www.tradingview.com/script/lut7sBgG-Range-Filter-DW/
// This version is the old version of the Range Filter with less settings to tinker with- 1

