Type/to search

Двухбоксовая система отслеживания тренда

Common strategy
Created: 2023-11-02 17:19:22
Last modified: 3 years ago
1
Follow
1802
Followers

Overview

The Trend Following System is a trend tracking strategy based on a double box system. It uses a long-term box to determine the overall trend direction and takes signals that align with the major trend when the short-term box triggers. This strategy follows trends while managing risks.

Strategy Logic

The strategy uses two boxes to determine the trend. The long-term box uses a longer period to judge the major trend direction, and the short-term box uses a shorter period to generate trading signals.

First, the strategy calculates the highest and lowest prices of the long-term box to determine the major trend direction. The trend direction can be:

  • If the highest price crosses above the highest price of the previous bar, it is defined as an uptrend, assigned a value of 1
  • If the lowest price crosses below the lowest price of the previous bar, it is defined as a downtrend, assigned a value of -1
  • Otherwise, maintain the original trend direction

After determining the major trend, the strategy starts taking positions based on the short-term box signals. Specifically:

  • When the major trend is up and the short-term box's lowest price equals the previous bar's lowest price and is lower than the current short-term box's lowest price, go long.
  • When the major trend is down and the short-term box's highest price equals the previous bar's highest price and is higher than the current short-term box's highest price, go short.

In addition, stop loss and take profit are configured:

  • Long stop loss is the lowest price of the long-term box, short stop loss is the highest price of the long-term box
  • Long take profit is the highest price of the short-term box, short take profit is the lowest price of the short-term box

When the major trend reverses, close all positions.

Advantage Analysis

The advantages of this strategy include:

  1. The double box system effectively identifies trend directions and reduces incorrect trades
  2. Only taking reversal signals that align with the major trend avoids being misled by short-term market noise
  3. The combination of long and short periods ensures capturing major trends while maintaining position adjustment flexibility
  4. Reasonable stop loss and take profit points control risk while following trends
  5. Quickly flattening all positions when the major trend reverses minimizes losses

Risk Analysis

The risks of this strategy include:

  1. Неправильные настройки длинного и короткого периода могут привести к чрезмерной торговле или упущенным возможностям.
  2. Краткосрочные развороты могут не отражать долгосрочные изменения тренда, что по‑прежнему несёт риски убытков.
  3. Слишком близкий стоп-лосс может преждевременно закрыть позицию.
  4. Слишком свободный тейк-профит может не максимизировать прибыль.
  5. Неправильная оценка основного тренда приводит к убыткам.
  6. Решения включают корректировку периодов, оптимизацию стопов/целей, добавление фильтров и т.д.

Направления оптимизации

Стратегию можно улучшить:

  1. Добавление фильтров для избежания ложных пробоев.
  2. Оптимизация длинных и коротких периодов для разных инструментов.
  3. Динамическая корректировка уровней стоп-лосса и тейк-профита.
  4. Включение правил управления размером позиции.
  5. Использование объёма и т.д. для оценки надёжности изменений тренда.
  6. Использование машинного обучения для автоматической оптимизации параметров и фильтров.

Резюме

Система следования за трендом – это практичная трендовая стратегия, сочетающая определение тренда и краткосрочные корректировки. Благодаря постоянным оптимизациям она может стать надёжной автоматизированной системой, которая отслеживает тренды и одновременно контролирует риски. Она содержит основные принципы трендовой торговли и заслуживает углублённого изучения.

Source
Pine
/*backtest
start: 2023-10-25 00:00:00
end: 2023-10-26 07:00:00
period: 5m
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/
// © LonesomeTheBlue

//@version=4
Strategy parameters
Strategy parameters
Longterm Period
Shortterm Period
Show Target
Show Trend
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)