2倍移動平均振動取引戦略

作者: リン・ハーンチャオチャン, 日付: 2023-12-04 15:28:12
タグ:

img

概要

ダブル・ムービング・平均振動トレード戦略は,2/20指数移動平均とアダプティブ・価格ゾーン振動指標を組み合わせて振動する市場で利益を得ることで取引信号を生成する.この戦略は,株式指数,外為,商品,デジタル通貨などの明らかな振動特性を有する市場に主に適しています.

戦略原則

二重移動平均振動取引戦略は2つの部分からなる.

  1. 2/20 指数関数移動平均値.この指標は,価格が20日線を突破し,上昇する際に2日線を突破しないとき,購入信号を生成し,価格が2日線を突破し,減少する際に20日線を超えないとき,販売信号を生成する.

  2. アダプティブ価格ゾーン振動指標.この指標は,価格の変動範囲に基づいて価格帯を構成し,価格の上位および下位価格帯を突破した価格で市場のターニングポイントを判断し,購入および販売信号を生成します.

ダブル・ムービング・平均振動トレード戦略は,2/20指数移動平均値とアダプティブ・価格ゾーン振動指標が戦略トレードを実施するために同時にシグナルを発信するときにのみ実際のトレード信号を生成する. これにより,いくつかの無効な信号を効果的にフィルタリングし,シグナル品質を改善することができます.

利点分析

双動平均振動取引戦略は,動平均指標と波動指標の利点を組み合わせ,以下の特徴を有する.

  1. 信頼性の高い取引シグナル.ダブル・インディケーター・検証により,シグナル品質が向上し,無効なシグナルが効果的にフィルタリングされます.

  2. 変動する市場に適応する.移動平均値と価格帯指標の組み合わせは,変動する市場の転換点を正確に決定することができます.

  3. 操作頻度が適度である.二重指数移動平均戦略と比較して,無効な取引の発生を減らすことができます.

  4. 自動取引の実装が簡単です.シグナルルールは明確で,パラメータは設定が簡単で,自動取引を達成するためにプログラミングが簡単です.

リスク分析

双動平均振動取引戦略には,次のリスクもあります.

  1. 信号の遅延は大きい場合がある.ダブルインジケーターをフィルター信号に組み合わせると,迅速な価格逆転の機会が失われる可能性があります.

  2. 振動が弱くなる場合の不良業績.この戦略は主に振動する市場に依存し,波動が弱くなるにつれて取引信号と利益率は減少する.

  3. パラメータ最適化の重要な影響.指標パラメータ設定は取引結果により大きな影響を与える可能性があるため,最適なパラメータのために体系的に最適化する必要があります.

上記のリスクに対応して,パラメータを動的に調整し,市場の環境変化に適応し,ダウンリスクを制御するためのストップ損失戦略を設定するなど方法が採用できます.

オプティマイゼーションの方向性

二重移動平均振動取引戦略は,次の側面で最適化することができる:

  1. 移動平均値と価格帯の組み合わせをさらにテストする.最適なパラメータ組み合わせを見つけるために,移動平均値と異なる長さの価格帯を体系的にテストする.

  2. フィルター信号にボリュームインジケーターを追加します.異常な取引ボリューム信号を移動平均値の価格信号にフィルターすることで,信号の質をさらに改善できます.

  3. ダイナミックストップ・ロスのメカニズムを設定します. 市場の変動が弱くなると,単一の損失を減らすために適切なストップ・ロスのポイントを締めます.

  4. ディープラーニングモデルを組み合わせる. 戦略をより知的なものにするために,LSTMやその他のディープラーニングモデルを使用して取引信号を検証する.

概要

ダブル・ムービング・平均振動トレード戦略は,2/20指数移動平均とアダプティブ・価格ゾーン振動指標を組み合わせて高品質の振動トレード信号を生成し,株価指数,外為,変動が大きい商品などの不安定な市場に適応し,振動範囲内で頻繁な取引仲介を行うことができます.この戦略には,高い信号品質と簡単な自動化などの利点があります.同時に,ターニングポイントの遅延識別やパラメータのダイナミックな調整などのリスクも制御する必要があります.この根拠に基づいて最適化するにはまだ大きな余地があります.


/*backtest
start: 2023-11-03 00:00:00
end: 2023-12-03 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 02/03/2022
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This indicator plots 2/20 exponential moving average. For the Mov 
// Avg X 2/20 Indicator, the EMA bar will be painted when the Alert criteria is met.
//
// Second strategy
// The adaptive price zone (APZ) is a volatility-based technical indicator that helps investors 
// identify possible market turning points, which can be especially useful in a sideways-moving 
// market. It was created by technical analyst Lee Leibfarth in the article “Identify the 
// Turning Point: Trading With An Adaptive Price Zone,” which appeared in the September 2006 issue 
// of the journal Technical Analysis of Stocks and Commodities.
// This indicator attempts to signal significant price movements by using a set of bands based on 
// short-term, double-smoothed exponential moving averages that lag only slightly behind price changes. 
// It can help short-term investors and day traders profit in volatile markets by signaling price 
// reversal points, which can indicate potentially lucrative times to buy or sell. The APZ can be 
// implemented as part of an automated trading system and can be applied to the charts of all tradeable assets.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
EMA20(Length) =>
    pos = 0.0
    xPrice = close
    xXA = ta.ema(xPrice, Length)
    nHH = math.max(high, high[1])
    nLL = math.min(low, low[1])
    nXS = nLL > xXA or nHH < xXA ? nLL : nHH
    iff_1 = nXS < close[1] ? 1 : nz(pos[1], 0)
    pos := nXS > close[1] ? -1 : iff_1
    pos

APZ(nPeriods,nBandPct) =>
    pos = 0.0
    xHL = high - low
    nP = math.ceil(math.sqrt(nPeriods))
    xVal1 = ta.ema(ta.ema(close,nP), nP)
    xVal2 = ta.ema(ta.ema(xHL,nP), nP)
    UpBand = nBandPct * xVal2 + xVal1
    DnBand = xVal1 - nBandPct * xVal2
    pos := low < DnBand ? 1 : high > UpBand ? -1 : pos[1] 
    pos

strategy(title='Combo 2/20 EMA & Adaptive Price Zone', shorttitle='Combo', overlay=true)
var I1 = '●═════ 2/20 EMA ═════●'
Length = input.int(14, minval=1, group=I1)
var I2 = '●═════ Adaptive Price Zone  ═════●'
nPeriods = input(20)
nBandPct = input(2)
var misc = '●═════ MISC ═════●'
reverse = input.bool(false, title='Trade reverse', group=misc)
var timePeriodHeader = '●═════ Time Start ═════●'
d = input.int(1, title='From Day', minval=1, maxval=31, group=timePeriodHeader)
m = input.int(1, title='From Month', minval=1, maxval=12, group=timePeriodHeader)
y = input.int(2005, title='From Year', minval=0, group=timePeriodHeader)

StartTrade = time > timestamp(y, m, d, 00, 00) ? true : false
posEMA20 = EMA20(Length)
prePosAPZ = APZ(nPeriods,nBandPct)
iff_1 = posEMA20 == -1 and prePosAPZ == -1 and StartTrade ? -1 : 0
pos = posEMA20 == 1 and prePosAPZ == 1 and StartTrade ? 1 : iff_1
iff_2 = reverse and pos == -1 ? 1 : pos
possig = reverse and pos == 1 ? -1 : iff_2
if possig == 1
    strategy.entry('Long', strategy.long)
if possig == -1
    strategy.entry('Short', strategy.short)
if possig == 0
    strategy.close_all()
barcolor(possig == -1 ? #b50404 : possig == 1 ? #079605 : #0536b3)

もっと