価格振動に二重自信を持つ量戦略

作者: リン・ハーンチャオチャン,日付: 2024-02-18 10:10:16
タグ:

img

概要

この戦略の主な考え方は,123リバース戦略と絶対価格オシレーター指標を組み合わせて統合された信号を得ることです.特に,両方のサブ戦略が長信号を発信した場合,最終戦略信号は1 (長);両方が短信号を発信した場合,最終信号は-1 (短);信号が一貫していない場合,最終信号は0 (操作なし).

原則

123 リバース戦略の原則は,閉店価格が前日の閉店価格より 2 日連続で低く,ストコスタスティックオシレータがオーバーセールラインを下回っている場合,ロング;閉店価格が前日の閉店価格より 2 日連続で高く,ストコスタスティックオシレータがオーバーセールラインの上回っている場合,ショート.

二つ目に,絶対価格振動器は2つの指数関数移動平均値の差を示します. プラス値は上昇傾向を示し,マイナス値は下落傾向を示します.

最後にこの戦略は2つのサブ戦略のシグナルを組み合わせます つまり,シグナルが一貫している場合,シグナルに従います.そうでなければ,動作しません.

利点分析

この戦略は,短期の逆転信号と中期から長期間のトレンド信号を包括的に考慮し,転換点を効果的に特定することができます.123逆転またはAPOのみを使用すると比較して,この戦略は信号の信頼性を大幅に向上させ,誤った信号を削減することができます.

また,この戦略では,単一の指標に頼るのではなく,複数の技術指標を用いて市場を包括的に判断します.これは,1つの指標の失敗による誤った判断を回避します.

リスク分析

123 リバーサルとAPOが矛盾する信号を発信するときに最大のリスクがあります.そのような場合,オペレーターは経験に基づいてどの信号がより信頼性があるかを判断する必要があります.間違った判断は,取引機会を逃したり損失を招く可能性があります.

また,急激な市場変化は,両方のサブ戦略からの信号を同時に無効にすることがあります.トレーダーは,市場に大きく影響を与えるイベントを監視し,必要に応じて戦略を一時停止する必要があります.

最適化

可能な最適化方向:

  1. より信頼性の高い信号,例えば移動平均期間のためのサブ戦略パラメータを最適化する.

  2. 投票メカニズムを形成するために他の補助指標を追加します.複数の指標からの一貫した信号はより信頼性があります.

  3. ストップ・ロスの戦略を追加します.価格の不良動向に適したストップ・ロスはさらなる損失を回避します.

  4. 過去のバックテストに基づいてエントリーとストップ損失レベルを最適化します

結論

この戦略は,市場を判断するために複数の技術指標を組み合わせ,単一指標依存リスクを一定程度回避し,信号精度を向上させる.投資家の要求に基づいて最適化することも可能である.全体として,Doubly Confident Price Oscillation Quant Strategyは信頼できる取引信号を提供し,さらなる調査に値する.


/*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 ) 

もっと