双方向バンドフィルタリング戦略


作成日: 2023-10-24 17:00:02 最終変更日: 2023-10-24 17:00:02
コピー: 0 クリック数: 600
1
フォロー
1617
フォロワー

双方向バンドフィルタリング戦略

[trans]

概要

双面波段フィルタリング戦略は,ブロードが2010年にブロード株式と商品誌で発表した記事を基に改訂された戦略である. この戦略は,ブロード波段フィルタルの数値を計算し,株式価格の変動を認識し,取引信号を与える.ブロード波段フィルタルの数値が値より高いときは見下し,値より低いときは見多し,トレンドフォローを実現する.

戦略原則

この戦略は以下のステップで構成されています.

  1. 初期化パラメータ: ブロードバンド長を含むLength波動系数についてDelta余剰余剰の値が下がったSellZone複数の区間の値を見るBuyZone待って。

  2. ブロードバンドフィルタを計算するBP: 波段フィルターの値を,一連の三角関数で計算する。

  3. ポジションの方向を判断する:BPより高いSellZone値が0より低い場合はBuyZoneポジションを維持する.

  4. 出力シグナル:保有方向に合わせて多空シグナルを出力する.

  5. Kラインの色を描く:信号結果に応じてKラインの色を設定する.

  6. 波段フィルター曲線を描画する.

この戦略は,市場における短期的な波動をブロードバンドフィルターで捕捉し,波動が一定の幅に達したときに取引シグナルを生成し,市場動向に従って取引する.

優位分析

  1. ブロードバンドフィルターにより,市場の波動に敏感になり,短期的なトレンドを捉えることができます.

  2. パラメータの最適化により,波動に対する感度が調整され,異なる市場環境に適応できます.

  3. 戦略の論理はシンプルで明快で,実行が分かりやすい.

  4. パラメータを簡単に調整し,最適なパラメータの組み合わせを探します.

  5. 視覚化された波段フィルター曲線,市場波動を直感的に表示する.

リスク分析

  1. ブロードバンドフィルターは,過度に最適化すると過度に敏感になり,誤った信号を生成する可能性があります.

  2. 波動の終点が特定できないため,損失が拡大する可能性があります.

  3. 取引の頻度が高くなり,取引コストや滑り場リスクが増加する可能性があります.

  4. 突発的な事件の影響を受けやすいため,誤信号が生成される.

  5. 異なる品種と市場環境に対応するためにパラメータを適切に調整する必要があります.

  6. 単一損失をコントロールするために,ストップ・ロスを設定することも考えられます.

  7. 適切な出場時間を延長するか,誤信号を減らすためにフィルタリング条件を使用する.

最適化の方向

  1. パラメータを最適化して,最適なパラメータ組み合わせを見つける.最適化の目標は,勝率,損益率,シャープ比率などの指標を考慮することができる.

  2. フィルタリング条件を追加します.例えば,平均線や価格パターンを突破し,トレンド外での取引を避けるようにします.

  3. 複数の指標を組み合わせたパラメータの組み合わせを考慮してバスケット取引を行い,一方的なリスクを分散する.

  4. ストップロジックを追加し,単一損失を制御する. ダイナミックストップまたは追跡ストップを考慮することができます.

  5. モバイルストップを追加し,プロフィートをロックします. トレンドの段階に応じて異なるストップ位置を設定することもできます.

  6. 入場シグナルを最適化して,波動的な市場での誤信号を避ける. ポジション保持周期を延長したり,入場シグナルとして価格突破を設定することも考えられます.

  7. 品種間の価格差をカバーする多品種アベレージシステムに拡張.

  8. 採集と最適化,最良の品種選択と採集戦略

要約する

双方向波段フィルタリング戦略は,価格変動の強さを判断するブロードバンドフィルターを計算し,波動が値に達したときに取引信号を生成し,市場短期トレンドに対する高い感受性を持ち,簡単に実現する利点があります.しかし,この戦略はパラメータと取引頻度に敏感であり,誤信号を減らすために適切な最適化が必要であり,リスクを制御します.全体的に,この戦略は,短期トレンドを捕捉するためのオプションを提供していますが,最適化の問題を警戒し,他の技術指標と適切に連携して取引する必要があります.

||

Overview

The Dual Bandpass Filter strategy is adapted from the strategy published by Broder in Stocks & Commodities magazine in 2010. It generates trading signals by calculating the value of Broder’s bandpass filter to identify price fluctuations in stocks. It goes short when the bandpass filter value is higher than the threshold, and goes long when it is lower, to follow the trend.

Strategy Logic

The key steps of this strategy are:

  1. Initialize parameters including bandpass length Length, fluctuation coefficient Delta, short zone threshold SellZone, and long zone threshold BuyZone.

  2. Calculate the Broder bandpass filter BP using a series of trigonometric functions.

  3. Determine position direction: go short if BP is above SellZone; go long if below BuyZone; otherwise, maintain current position.

  4. Output signals: generate long/short signals based on position direction.

  5. Set bar colors based on signal results.

  6. Plot the bandpass filter curve.

This strategy captures short-term fluctuations using the Broder bandpass filter, and generates trading signals when the fluctuations reach certain magnitude to follow the trend.

Advantage Analysis

  1. More sensitive to market fluctuations based on the Broder bandpass filter, which can catch short-term trends.

  2. The sensitivity can be adjusted through parameter tuning to adapt to different market environments.

  3. Simple and clear strategy logic, easy to understand and implement.

  4. Parameters can be easily optimized to find the best combination.

  5. Visual bandpass filter curve intuitively shows market fluctuations.

Risk Analysis

  1. Overly optimized bandpass filter may become too sensitive and generate false signals.

  2. Unable to determine fluctuation end points, may lead to expanding losses.

  3. High trading frequency may increase costs and slippage risks.

  4. Vulnerable to black swan events that trigger false signals.

  5. Parameters need adjusting for different products and markets.

  6. Consider setting stop loss to control loss per trade.

  7. Extend exit time or add filters to reduce false signals.

Optimization Directions

  1. Optimize parameters to find the best combination, evaluating win rate, profit ratio, Sharpe ratio etc.

  2. Add filters like moving average cross, price patterns to avoid trading in non-trending areas.

  3. Consider combining parameters across multiple instruments for basket trading to diversify risks.

  4. Add stop loss logic to control loss per trade, like dynamic stops or trailing stops.

  5. Add profit taking like moving profit stops to lock in gains. Different levels can be set for different trend stages.

  6. Optimize entry signals to avoid false signals in ranging markets. Consider longer holding periods or breakout signals.

  7. Expand to a cross-asset arbitrage system utilizing price differentials for hedging.

  8. Backtest optimization for best asset selection and rebalancing strategies.

Summary

The Dual Bandpass Filter strategy judges price fluctuations using Broder’s bandpass filter and generates signals when the fluctuations reach thresholds, with the advantage of high sensitivity to short-term trends and easy implementation. However, it is sensitive to parameters and trading frequency, requiring optimization to reduce false signals and manage risks. Overall, it provides an option for catching short-term trends, but overfitting should be avoided, and other technical tools can be combined for trading.

ストラテジーソースコード
/*backtest
start: 2022-10-17 00:00:00
end: 2023-10-23 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 18/09/2018
// The related article is copyrighted material from
// Stocks & Commodities Mar 2010
// You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Bandpass Filter Strategy ver 2.0")
Length = input(20, minval=1)
Delta = input(0.5)
SellZone = input(5, step = 0.01)
BuyZone = input(-5, step = 0.01)
reverse = input(false, title="Trade reverse")
hline(BuyZone, color=green, linestyle=line)
hline(SellZone, color=red, linestyle=line)
xPrice = hl2
hline(0, color=blue, linestyle=line)
beta = cos(3.14 * (360 / Length) / 180)
gamma = 1 / cos(3.14 * (720 * Delta / Length) / 180)
alpha = gamma - sqrt(gamma * gamma - 1)
BP = 0.5 * (1 - alpha) * (xPrice - xPrice[2]) + beta * (1 + alpha) * nz(BP[1]) - alpha * nz(BP[2])
pos = iff(BP > SellZone, 1,
	   iff(BP <= BuyZone, -1, nz(pos[1], 0))) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue )  
plot(BP, color=red, title="Bandpass Filter Strategy")