Reversal and Linear Regression Intercept Combo Strategy
Overview
This strategy combines the 123 reversal strategy and linear regression intercept strategy to implement a multi-factor driven combo trading strategy. The 123 reversal strategy judges the price relationship between the last two trading days and combines the Stoch indicator to determine the reversal signal. The linear regression intercept strategy uses linear regression analysis to judge the relationship between price and trend line and generate trading signals. The two strategies verify each other and can effectively filter false signals.
Strategy Principle
123 Reversal Strategy
The strategy is based on the following principles:
-
If the closing price relationship between the last two trading days is today's closing price higher than yesterday's, and the Stoch fast line is lower than the slow line, it is considered that there is a bullish reversal signal
-
If the closing price relationship between the last two trading days is today's closing price lower than yesterday's, and the Stoch fast line is higher than the slow line, it is considered that there is a bearish reversal signal
The judgment rules are as follows:
-
If today's closing price > yesterday's closing price and Stoch fast line < Stoch slow line and Stoch fast line > set parameter, generate buy signal
-
If today's closing price < yesterday's closing price and Stoch fast line > Stoch slow line and Stoch fast line < set parameter, generate sell signal
The strategy needs to set Stoch indicator parameters, including: K line cycle Length for Stoch calculation, smoothing cycle KSmoothing for Stoch fast line, smoothing cycle DLength for Stoch slow line, threshold Level for Stoch fast line judgment.
Linear Regression Intercept Strategy
The strategy is based on linear regression analysis to judge the relationship between price and linear regression trend line. The judgment rules are as follows:
-
If the closing price is greater than the linear regression intercept, a buy signal is generated
-
If the closing price is less than the linear regression intercept, a sell signal is generated
The strategy needs to set the linear regression cycle LengthLRI and the linear regression input data source xSeria.
Combo Strategy
The combo strategy requires simultaneous buy/sell signals from both the 123 reversal strategy and the linear regression intercept strategy to generate actual trading orders, which effectively filters out false signals and improves trading performance.
Advantage Analysis
The strategy has the following advantages:
- Multi-factor driven, effectively filter out false signals and improve signal quality
The combination of two different types of strategies requires signals from both strategies to actually place orders. This multi-factor verification mechanism can filter out occasional wrong signals from a strategy, reduce unnecessary trading, and effectively improve signal quality.
- Real-time monitoring of price and trend relationships avoids being trapped
The linear regression intercept can reflect the relationship between price and trend line in real time. If the price deviates significantly from the trend, it will promptly prompt the strategy to adjust the position direction. This allows timely stop losses and avoids being trapped in historical trends.
- Take into account trading opportunities for both trends and reversals
The linear regression strategy is better at identifying trend buy and sell points. While the 123 reversal strategy focuses on identifying reversal points. The two strategies can combine the advantages of trend trading and reversal trading.
- Customizable parameter optimization of strategies
Both strategies provide certain parameters for customization, which can be optimized for different varieties and different trends to optimize the effect of the combined strategy.
Risk Analysis
The strategy also has the following risks:
- Multi-factor drivers may miss some opportunities
The need to meet the trading signals of both strategies will miss some opportunities that can be profitable relying solely on a single strategy. If one strategy weakens, it will drag down the overall trading performance.
- Linear regression has lag
Linear regression requires some historical data for calculation and cannot respond in real time to sudden events, resulting in some lag. If there is a large price gap, the linear regression trend line will take some time to adjust, which may generate wrong signals during this period.
- Reasonable parameter optimization is needed
Both strategies require appropriate parameter selection, which may need to be adjusted independently for some varieties. Improper parameter selection will greatly reduce the effectiveness of the strategy.
The risks can be reduced through the following methods:
-
Appropriately relax the combo signal triggering conditions to prevent missing too many opportunities
-
Combine trend indicators to replace linear regression to obtain more real-time trend judgments
-
Use machine learning methods to assist parameter optimization and improve parameter selection
Optimization Directions
The strategy can be further optimized in the following ways:
- Use machine learning methods for parameter optimization
Collect historical data, design parameter optimization goals, and use machine learning algorithms such as genetic algorithms and Bayesian optimization to search for the best parameter combinations.
- Add stop-loss mechanism
Stop-loss rules can be set based on ATR, trend indicators, etc. to control maximum loss per trade.
- Optimize entry and exit logic
Auxiliary conditions such as moving average filters and Bollinger Bands can be added on the basis of trading signals to reduce the frequency of position adjustments and avoid being trapped.
- Combine sentiments analysis
Use natural language processing techniques to determine market participant sentiment and assist in trading decisions.
- Add machine learning prediction module
Use deep learning models like LSTM and GRU to predict prices as an important reference for strategy decisions.
Summary
This strategy combines the 123 reversal strategy and linear regression intercept strategy to implement multi-factor driven quantitative trading. The verification mechanism can effectively filter out false signals and capture reversal and trend trading opportunities. But there are also certain lag risks in the strategy that require attention to parameter optimization and expansion of risk control mechanisms to further improve strategy stability. Combining machine learning and other technologies for parameter optimization and feature expansion is a worthwhile further optimization direction for the strategy to explore.
/*backtest
start: 2023-09-18 00:00:00
end: 2023-09-19 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 25/01/2021
// This is combo strategies for get a cumulative signal. - 1
