Type/to search

Deviation-Based Trend Tracking Strategy

Common strategy
Created: 2024-01-22 11:51:28
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy identifies and tracks trends based on price deviation indicators combined with Fibonacci retracement areas. Trading signals are generated when the price deviates further and further from one direction.

Strategy Logic

The strategy uses VWAP as the midpoint line of the price. Then the upper and lower bands of 1.618 and 2.618 standard deviation of price fluctuations are calculated. A long signal is generated when the price breaks through the lower band upwards. A short signal is generated when the price breaks through the upper band downwards.

The stop loss EXIT signals after opening long or short positions are: the stop loss line for long positions is the lower band, and for short positions is the upper band.

Specifically, it involves the following steps:

  1. Calculate VWAP as the midpoint line of the price

  2. Calculate the standard deviation sd of the price as an indicator of price volatility

  3. Calculate the upper and lower bands based on sd. The upper bands are VWAP + 1.618sd and VWAP + 2.618sd. The lower bands are VWAP - 1.618sd and VWAP - 2.618sd.

  4. A long signal is generated when the price breaks through the 1.618 lower band upwards. A short signal is generated when the price breaks through the 1.618 upper band downwards.

  5. Long stop loss EXIT: price breaks through 2.618 lower band; Short stop loss EXIT: price breaks through 2.618 upper band.

Advantage Analysis

The strategy has the following advantages:

  1. Price deviation indicators can effectively determine price trends and track trends

  2. Fibonacci retracement areas make entry and stop loss exits clearer

  3. VWAP as the midpoint line of the price also enhances the reference value of the indicator

  4. Parameters can be adjusted to suit different products and timeframes

Risk Analysis

The strategy also has some risks:

  1. It may incur greater losses during trend reversals

  2. Improper parameter settings can also affect strategy performance

  3. There is a higher stop loss risk during violent price fluctuations

Countermeasures:

  1. Appropriately shorten the holding period and stop losses in time

  2. Optimize parameters to find the best parameter combination

  3. Increase position sizing management to control single loss

Optimization Directions

The strategy can also be optimized in the following areas:

  1. Incorporate trend indicators to avoid counter trend trading

  2. Add position sizing management mechanisms

  3. Optimize parameter settings

  4. Backtest and optimize over multiple timeframes

Summary

This strategy identifies and tracks trends based on the price deviation concept combined with VWAP and Fibonacci standard deviation bands. Compared to using single indicators like moving averages, this strategy has clearer judgments and risk control. Through parameter adjustment and optimization, the strategy can be adapted to different products and timeframes to achieve better performance.

Source
Pine
/*backtest
start: 2024-01-14 00:00:00
end: 2024-01-21 00:00:00
period: 1m
basePeriod: 1m
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/
// © Mysteriown

//@version=4
Strategy parameters
Strategy parameters
Fibo extension 1
Fibo extension 2
Resolution VWAP
Deviation value min.
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)