ダブルボックストレンド追跡システム


作成日: 2023-11-02 17:19:22 最終変更日: 2023-11-02 17:19:22
コピー: 0 クリック数: 647
1
フォロー
1617
フォロワー

ダブルボックストレンド追跡システム

概要

トレンド追跡システムは,2つの箱制度に基づくトレンド追跡戦略である.これは,長期周期の箱体を使って全体的なトレンドの方向性を判断し,短期の箱体でシグナルが生じるときに,長期トレンドの方向に一致する取引シグナルを入力する.この戦略は,トレンドを追跡して,利益を最大化しながらリスクを制御する.

戦略原則

この戦略は,2つの箱体でトレンドを判断する.長期箱体は長周期で主要トレンドの方向を判断し,短期箱体は短周期で特定の取引信号を判断する.

戦略は,まず,長期ボックスの最高価格と最低価格を計算し,主要なトレンド方向を判断する.トレンド方向は3種類に分けられる:

  • 最高価格の上にK線をつけている最高価格,上昇傾向で定義され,1の付加値
  • 最低値の下のK線にK線を挿入する 最低値,下降傾向として定義され,値-1
  • 変化しないようにする

主なトレンドの方向性を判断した後,短期ボックスの入場に基づいて戦略を開始します.具体的には:

  • 主なトレンドが上昇し,短期ボディの最低価格は上方のK線の最低価格に等しく,現在の短期ボディの最低価格より低くなると,多めにします.
  • 主なトレンドが下向きで,短期ボックスの最高値が上K線の最高値と現在の短期ボックスの最高値より高いとき,空白

ストップ・ローズとストップ・ストップの設定は,

  • 多単位のストップは長期箱の最低価格,空単位のストップは長期箱の最高価格
  • 多単止は短期箱体の最高価格,空単止は短期箱体の最低価格

主なトレンドが逆転すると,すべてのポジションを平仓する.

優位分析

この戦略の利点は以下の通りです.

  1. 双箱判定システムを使用し,トレンドの方向を効果的に識別し,誤った取引の確率を下げる
  2. 短期市場騒音に惑わされないために,短期的な反転信号が長期のトレンドの方向と一致している場合にのみ入場します.
  3. 長期・短期間の配合により,主要トレンドを把握する能力と,適切なポジション調整の柔軟性を確保
  4. ストップ・ストップ・ポイントの設定は合理的で,トレンドの実行を把握しながらリスクをコントロールできます.
  5. 主なトレンドの転換時に迅速に平仓し,損失を制御する

リスク分析

この戦略には以下のリスクもあります.

  1. 短期間の設定が不適切で,取引が頻繁になるか,機会が逃れやすい
  2. 短期的なトレンドの逆転が長期的トレンドの逆転を意味しているとは限りません.
  3. ストップポイントが近づいてしまうと,市場から追い出されてしまう.
  4. ストップポイントが過度に緩やかになり,利益の最大化ができない
  5. 長期トレンド判断の誤りで,その後の取引損失が拡大する
  6. これらのリスクに対処する方法は,長短周期パラメータの調整,停止停止位置の最適化,フィルタリング条件の増加などである.

最適化の方向

この戦略は以下の点で最適化できます.

  1. フィルタリング条件を追加し,短期的な偽突破によって誤導される信号を避ける.
  2. 長短周期のパラメータを最適化して,異なる品種特性に適合させる
  3. 動的に止損停止の位置を調整して,止損をより正確に止めて,止止をより充分に止めてください
  4. ポジション管理策を導入し,ポジションの規模を合理化
  5. トレンド転換を判断するVolumeなどの指標と組み合わせた信頼性
  6. 機械学習によるパラメータとフィルタリング条件の自動最適化

要約する

トレンド追跡システム全体は,非常に実用的なトレンド追跡戦略である.それは,トレンド判断と短期的な調整の能力を兼ね備えて,トレンドを追跡しながらもリスクを制御することができる.継続的な最適化によって,この戦略は,強力な自動化されたトレンド取引システムになる可能性がある.それは,トレンド取引の核心哲学を包含しており,深い研究に値する.

||

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. Improper long and short period settings may cause overtrading or missing opportunities
  2. Short-term reversals may not represent long-term trend changes, still posing loss risks
  3. Stop loss too close may get stopped out prematurely
  4. Take profit too loose may not maximize profits
  5. Wrong judgment of the major trend leads to losses
  6. Solutions include adjusting periods, optimizing stops/targets, adding filters etc.

Optimization Directions

The strategy can be improved by:

  1. Adding filters to avoid false breakouts
  2. Optimizing long and short periods for different products
  3. Dynamically adjusting stop loss and take profit levels
  4. Incorporating position sizing rules
  5. Using volume etc. to judge reliability of trend changes
  6. Utilizing machine learning to auto-optimize parameters and filters

Summary

The Trend Following System is a practical trend trading strategy combining trend determination and short-term adjustments. With continuous optimizations, it can become a robust automated system that tracks trends while controlling risks. It contains the core philosophies of trend trading and is worth in-depth studying.

[/trans]

ストラテジーソースコード
/*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("Grab Trading System", overlay = true)
flb = input(defval = 80, title = "Longterm Period", minval = 1)
slb = input(defval = 21, title = "Shortterm Period", minval = 1)
showtarget = input(defval = true, title = "Show Target")
showtrend = input(defval = true, title = "Show Trend")

major_resistance = highest(flb)
major_support = lowest(flb)
minor_resistance = highest(slb)
minor_support = lowest(slb)

var int trend = 0
trend := high > major_resistance[1] ? 1 : low < major_support[1] ? -1 : trend
strategy.entry("Buy", true, when = trend == 1 and low[1] == minor_support[1] and low > minor_support)
strategy.entry("Sell", false, when = trend == -1 and high[1] == minor_resistance[1] and high < minor_resistance)

if strategy.position_size > 0
    strategy.exit("Buy", stop = major_support, comment = "Stop Buy")
    if high[1] == minor_resistance[1] and high < minor_resistance
        strategy.close("Buy", comment ="Close Buy")
    
if strategy.position_size < 0
    strategy.exit("Sell", stop = major_resistance, comment = "Stop Sell")
    if low[1] == minor_support[1] and low > minor_support
        strategy.close("Sell", comment ="Close Sell")

if strategy.position_size != 0 and change(trend)
    strategy.close_all()
    
majr = plot(major_resistance, color = showtrend and trend == -1 and trend[1] == -1 ? color.red : na)
majs = plot(major_support, color = showtrend and trend == 1 and trend[1] == 1 ? color.lime : na)
minr = plot(minor_resistance, color = showtarget and trend == 1 and strategy.position_size > 0 ? color.yellow : na, style = plot.style_circles)
mins = plot(minor_support, color = showtarget and trend == -1 and strategy.position_size < 0 ? color.yellow : na, style = plot.style_circles)

fill(majs, mins, color = showtrend and trend == 1 and trend[1] == 1 ? color.lime : na, transp = 85)
fill(majr, minr, color = showtrend and trend == -1 and trend[1] == -1 ? color.red : na, transp = 85)