二重信頼価格ショック定量戦略


作成日: 2024-02-18 10:10:16 最終変更日: 2024-02-18 10:10:16
コピー: 1 クリック数: 542
1
フォロー
1617
フォロワー

二重信頼価格ショック定量戦略

概要

この戦略の主な考えは,123反転戦略と絶対価格変動指標の2つの異なるタイプの戦略を組み合わせて,統合信号を得るというものです.具体的には,両戦略が多発信号を発信した場合,最終戦略信号は1 ((多発) である.両戦略が空調信号を発信した場合,最終戦略信号は-1 ((空調) である.両戦略の信号が一致しない場合,最終信号は0 ((無操作) である.

戦略原則

まず,123逆転戦略の原則は,閉盘価格が前日の閉盘価格より2日連続で低く,ランダムな指標が超買線より低かったら,多めに買い,閉盘価格が前日の閉盘価格より2日連続で高く,ランダムな指標が超売り線より高かったら,空売り.

第二に,絶対価格変動指標は,2つの指数移動平均の間の差値を示している. 急速移動平均が遅い移動平均より高いときは正であり,向上傾向を示している. 逆は負であり,下向き傾向を示している.

最後に,この戦略は2つの子戦略の信号を組み合わせ,すなわち,両者が一致する信号を発した場合は,その信号に従って操作する.そうでなければ操作は行わない.

優位分析

この戦略は,短期的な反転信号と価格の中長期のトレンドを総合的に考慮し,市場情勢の転換点を効果的に識別することができる.123の反転またはAPO指標を単独で使用すると比較して,この戦略は,信号の信頼性を大幅に高め,誤った信号の発生を減らすことができます.

また,この戦略は,複数の技術指標を用い,市場動向を全体的に判断し,特定の指標だけに依存しない.これは,特定の指標の失敗によって全体的な判断の誤りが生じる状況を防ぐことができる.

リスク分析

この策略の最大のリスクは,123反転策略とAPO指標が異なった信号を生む状況にある.この場合,オペレーターは,自分の経験に基づいてどちらの信号がより信頼できるかを判断する必要があります.判断が偏っている場合,取引機会が逃れ,または損失が発生する可能性があります.

また,市場が急激に変化し,短期逆転信号と中長線トレンド信号が同時に失効した場合,戦略の信号も誤りが生じます. 操作者は,主要な政治経済イベントが市場に影響を及ぼすことに注意する必要があります. 必要に応じて,戦略の実行を一時停止することができます.

最適化の方向

この戦略は以下の方向から最適化できます.

  1. 優化子策略のパラメータにより,子策略の信号がより信頼性が高くなります.例えば,移動平均周期パラメータを調整します.

  2. 他の補助判断指標を追加し,投票メカニズムを形成する.複数の指標が一致した信号を発信すると,信号の信頼性が高くなります.

  3. 価格動きが技術指標の予想に合わないとき,時効的なストップは,損失を拡大し続けるのを防ぐことができます.

  4. ポジション開設とストップの位置を最適化する. 過去のリターンデータと組み合わせて,より適切な具体的な値を設定する.

要約する

この戦略は,複数の技術指標を総合的に使用して状況を判断し,単一の指標に依存するリスクをある程度回避し,シグナル判断の正確性を向上させる.また,この戦略には一定の最適化余地があり,投資家は自分のニーズに応じてパラメータを調整することができます.全体的に,二重自信価格振動量化戦略シグナルは,信頼性の高い取引戦略であり,さらなる研究と応用に値する.

ストラテジーソースコード
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 22/04/2019
// This is combo strategies for get 
// a cumulative signal. Result signal will return 1 if two strategies 
// is long, -1 if all strategies is short and 0 if signals of strategies is not equal.
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The 
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close 
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
// The strategy sells at market, if close price is lower than the previous close price 
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Secon strategy
// The Absolute Price Oscillator displays the difference between two exponential 
// moving averages of a security's price and is expressed as an absolute value.
// How this indicator works
//    APO crossing above zero is considered bullish, while crossing below zero is bearish.
//    A positive indicator value indicates an upward movement, while negative readings 
//      signal a downward trend.
//    Divergences form when a new high or low in price is not confirmed by the Absolute Price 
//      Oscillator (APO). A bullish divergence forms when price make a lower low, but the APO 
//      forms a higher low. This indicates less downward momentum that could foreshadow a bullish 
//      reversal. A bearish divergence forms when price makes a higher high, but the APO forms a 
//      lower high. This shows less upward momentum that could foreshadow a bearish reversal.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
    vFast = sma(stoch(close, high, low, Length), KSmoothing) 
    vSlow = sma(vFast, DLength)
    pos = 0.0
    pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
	         iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
	pos

AbsolutePriceOscillator(LengthShortEMA, LengthLongEMA) =>
    xPrice = close
    xShortEMA = ema(xPrice, LengthShortEMA)
    xLongEMA = ema(xPrice, LengthLongEMA)
    xAPO = xShortEMA - xLongEMA
    pos = 0.0    
    pos := iff(xAPO > 0, 1,
           iff(xAPO < 0, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal and Absolute Price Oscillator (APO)", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
LengthShortEMA = input(10, minval=1)
LengthLongEMA = input(20, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posAbsolutePriceOscillator = AbsolutePriceOscillator(LengthShortEMA, LengthLongEMA)
pos = iff(posReversal123 == 1 and posAbsolutePriceOscillator == 1 , 1,
	   iff(posReversal123 == -1 and posAbsolutePriceOscillator == -1, -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)	 
if (possig == 0) 
    strategy.close_all()
barcolor(possig == -1 ? red: possig == 1 ? green : blue )