Type/to search

Adaptive Stop Loss Rail Strategy

Common strategy
Created: 2024-01-02 11:10:54
Last modified: 3 years ago
1
Follow
1802
Followers

img

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:

  1. Kalman filter

    • Predict prices using recursive algorithm
    • Smooth prices and give predicted values
  2. 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
  3. 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:

  1. Kalman filter predicts prices
  2. Set stop loss rail based on predicted price and ratio
  3. As price moves towards favorable direction, stop loss rail approaches progressively to maximize profit
  4. If price breaks the rail, stop loss kicks in
  5. Increase position size to pyramid on losses
  6. Set up multiple take profit points to secure profit

Advantage Analysis

The main advantages of this strategy:

  1. Utilize Kalman filter to predict prices, smoother and more accurate than other indicators
  2. Adaptive stop loss rail can adjust based on actual situation to maximize profit
  3. Pyramiding and multiple take profit mechanism to yield more profit in trending moves
  4. Highly configurable parameters for flexible adjustments

Risk Analysis

The main risks of this strategy:

  1. StartStop may trigger frequently in ranging moves, increasing trading frequency and fees
  2. Although pyramiding mechanism can amplify gains in trends, it also increases risks and DD
  3. Although multiple take profit secures profit, it also reduces profit potential

Risks can be reduced through:

  1. Suspend trading in ranging market
  2. Adjust pyramiding and take profit parameters to lower risk

Optimization Direction

The strategy can be further optimized through:

  1. Add filters to identify trends and ranges
  2. Incorporate more indicators to filter false signals
  3. Consider clearing all positions if losses exceed certain threshold
  4. Add position sizing module
  5. 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.

Source
Pine
/*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

    //  ____  _        _____      _       _    _             _            
Strategy parameters
Strategy parameters
Kalman Gain:
Source:
Beginning Approach(%)
Final Approach(%)
Approach Decrease Step
Base Order Quantity
Max Safe Order Attemp
Safe Order Deviation
Profit Deviation
Max Take Profit(%)
Max Order Quantity
TP1(%)
QT1(%):
TP2(%)
QT2(%):
TP3(%)
QT3(%):
Stop Loss(%)
Long Entry
Short Entry
Safe Stop After TP2
Safe Stop After TP1
From Date:
/
/
To__ Date:
/
/
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)