Type/to search

Loft Stop Strategy

Cryptocurrency
Created: 2023-10-07 16:11:45
Last modified: 3 years ago
1
Follow
1781
Followers

Overview

This strategy uses a Kalman filter to track prices and dynamically adjusts the stop loss point with a stop loss line to achieve a sliding stop loss.

Principle

This strategy uses a Kalman filter to track prices in real time. The Kalman filter contains two equations:

Prediction equation:

smooth = kf[1] + dk * sqrt(gain / 10000 * 2)

Update equation:

kf = smooth + velo

where dk is the prediction error, gain is the Kalman gain that determines tracking sensitivity.

In addition, the strategy uses a sliding stop loss line to lock in profits. The initial stop loss distance is the stop loss percentage setting, such as 2%.

When long, if the price rises, the stop loss line also moves up gradually approaching the Kalman line, with a step size of downStep, such as 0.5%. If the price falls to the stop loss, reopen the position and set the initial stop loss distance.

Short is similar.

Thus, the strategy can gradually lock in profits according to the trend, with good risk management.

Advantages

  1. Use Kalman filter to track prices in real time with fast response.

  2. Lock in profits with sliding stop loss line, achieving good risk management. Customizable stop loss distance.

  3. Flexibly choose long/short or only long/short.

  4. Actively or conservatively stop loss based on trend.

  5. Flexibly set take profit and stop loss as needed.

Risks

  1. Improper parameter settings of Kalman filter may lead to unstable tracking.

  2. Slippage may trigger stop loss point prematurely. Widen stop loss distance appropriately.

  3. Sliding stop loss is not suitable for strong trending markets, should follow trend.

  4. Stop loss may trigger frequently in ranging markets. Widen stop loss distance or don't use sliding stop loss.

Optimization

  1. Incorporate more indicators to optimize entry timing.

  2. Adjust stop loss line movement step based on market volatility.

  3. Use machine learning to train optimal stop loss parameters.

  4. Incorporate more risk indicators to dynamically adjust position sizing.

Conclusion

The loft stop strategy uses a Kalman filter to track price changes and lock in profits with a sliding stop loss line, ensuring profitability while controlling risks. It is a reliable and easily optimized strategy. Combining it with trend judgment and dynamic position sizing can achieve even better strategy performance.

Source
Pine
/*backtest
start: 2023-09-06 00:00:00
end: 2023-10-06 00:00:00
period: 2h
basePeriod: 15m
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

//@version=5
Strategy parameters
Strategy parameters
Kalman Gain:
Source:
Beginning Approach(%):
Final Approach(%):
Approach Decrease Step:
Take Profit:
Stop Loss:
Long Entry
Short Entry
From Day
From Month
From Year
To Day
To Month
To Year
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)