Adaptive Stop Loss Rail Strategy
Overview
The main idea of this strategy is to combine Kalman filter and tracking stop loss to build a dynamically adjusted stop loss rail. The Kalman filter is used to track prices and give predicted values. The stop loss rail is constructed based on predictions at a certain percentage to achieve dynamic tracking of prices. This allows maximum profit during the trend phase while timely stop loss during reversal.
The whole strategy can achieve good results in trending markets.
Strategy Principle
The strategy consists of the following main parts:
-
Kalman filter
- Predict prices using recursive algorithm
- Smooth prices and give predicted values
-
Stop loss rail
- Constructed based on predicted values at set ratio
- The ratio will decrease gradually approaching predictions as bars progress
- Stop loss when price breaks the rail
-
Pyramiding and taking profit
- Use martingale method to add position on losses
- Set up multiple take profit points
The main operating flow of the whole strategy is:
- Kalman filter predicts prices
- Set stop loss rail based on predicted price and ratio
- As price moves towards favorable direction, stop loss rail approaches progressively to maximize profit
- If price breaks the rail, stop loss kicks in
- Increase position size to pyramid on losses
- Set up multiple take profit points to secure profit
Advantage Analysis
The main advantages of this strategy:
- Utilize Kalman filter to predict prices, smoother and more accurate than other indicators
- Adaptive stop loss rail can adjust based on actual situation to maximize profit
- Pyramiding and multiple take profit mechanism to yield more profit in trending moves
- Highly configurable parameters for flexible adjustments
Risk Analysis
The main risks of this strategy:
- StartStop may trigger frequently in ranging moves, increasing trading frequency and fees
- Although pyramiding mechanism can amplify gains in trends, it also increases risks and DD
- Although multiple take profit secures profit, it also reduces profit potential
Risks can be reduced through:
- Suspend trading in ranging market
- Adjust pyramiding and take profit parameters to lower risk
Optimization Direction
The strategy can be further optimized through:
- Add filters to identify trends and ranges
- Incorporate more indicators to filter false signals
- Consider clearing all positions if losses exceed certain threshold
- Add position sizing module
- Different parameter sets can be backtested and optimized for different markets
Summary
In summary, this adaptive stop loss rail strategy uniquely combines Kalman prediction and dynamic stop loss. With proper parameter tuning, it can achieve good results. Further modularization and optimization can make this strategy more complete for application in more markets.
/*backtest
start: 2023-06-01 00:00:00
end: 2024-01-01 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/
// © BigCoinHunter
// ____ _ _____ _ _ _ _ - 1

