Type/to search

Volatility Stop Tracking Strategy

Cryptocurrency
Created: 2023-12-01 17:53:36
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This is a trend tracking stop loss strategy based on price volatility. It uses Average True Range (ATR) to set stop loss lines for price fluctuations. ATR reflects the volatility and risk level of prices. When the price exceeds the stop loss line, the strategy judges the trend reversal and takes corresponding actions to open positions or stop losses.

Strategy Principle

The strategy first calculates the Average True Range (ATR) over a certain period. Then based on the current price trend direction, if it is an uptrend, the stop loss line is set to the current highest price minus n times the ATR; if it is a downtrend, the stop loss line is set to the current lowest price plus n times the ATR. The n value can be adjusted through parameters to control the distance between the stop loss line and the price.

When the price breaks through the stop loss line of the uptrend or the downtrend, the trend is judged to have changed. At this point, the strategy clears positions for stop loss and sets a new stop loss line based on the direction of the new trend.

In summary, the strategy uses price volatility to set stop loss lines to achieve accurate judgment of trend changes. Timely stop loss when the trend changes helps the strategy grasp the direction of the new trend.

Advantages of the Strategy

  • Use price volatility characteristics to judge trends and accurately grasp price turning points
  • Timely stop losses and switch positions to reduce risks of market reversals
  • Flexible parameter adjustment to control distance between stop loss line and price fluctuations
  • Parameters can be optimized for specific products for better adaptability

Risks of the Strategy

  • Risks of misjudgment due to invalid breakouts. Prices may have unsustainable invalid breakouts, causing misjudgments of trend changes
  • Overly aggressive parameter settings may increase losses. For example, when the n value is too large, the stop loss line is too close and small fluctuations may trigger it
  • The stop loss effect may be poor for low volatility products like currencies. Smaller ATR values mean stop loss lines are closer to prices

Optimization Directions

  • Auxiliary indicators like trading volume or volatility acceleration can be introduced to avoid misjudgment of invalid breakouts
  • Adjust n value based on characteristics of different products to make stop loss distance more appropriate
  • ATR period can also be optimized to choose the most suitable period parameter to judge price gap volatility

Summary

Overall this is a good algorithm implementation for setting stop loss lines based on price volatility. Its accuracy in judging price trends is high and it can capture key turning points of trends. It also provides some room for parameter tuning for better adaptability. As a stop loss strategy, it can effectively avoid risks of market reversals and is worth applying in live trading.

Source
Pine
/*backtest
start: 2022-11-30 00:00:00
end: 2023-11-30 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/
// © laptevmaxim92

//@version=4
Strategy parameters
Strategy parameters
length
mult
Use take profit?
Take profit pips
Use stop loss?
Stop loss pips
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)