反転予測とオシレーターの組み合わせ戦略


作成日: 2023-10-10 10:39:44 最終変更日: 2023-10-10 10:39:44
コピー: 1 クリック数: 651
1
フォロー
1617
フォロワー

概要

この戦略は,反転戦略と振動器戦略の組み合わせで,より信頼性の高い取引シグナルを得ることを目的としている.これは,反転予知戦略とChande予測振動器戦略を組み合わせて,両方の戦略が同時に買ったり売ったりするシグナルを発信すると,取引を実行する.

戦略原則

  1. 逆転予測策

    • ストキャスティック・オシレータの指標を用いて超買超売現象を判断する

    • 価格が連続して2つのバーの閉店価格に逆転し,ストキャスティックオシレータの指標がオーバーバイまたはオーバーセールシグナルを示したときに逆転操作を行う

  2. チャンデが予測した振動器の戦略

    • 線形回帰分析を用いた価格予測

    • 振動器曲線は,閉盘価格と予測価格の差値に等しい

    • 実際の価格と予測価格が明らかに偏っている場合,取引シグナルを生成します.

  3. 戦略ロジック

    • 逆転予測策とChandeの予測振動器策の信号を同時に計算する

    • 2つの戦略のシグナルが一致するときにのみ,つまり,両方が買入シグナルまたは売出シグナルである場合にのみ,実際の取引シグナルが生成される

    • 単一の戦略で発生する偽信号を組み合わせて除することで,信号の信頼性を高める.

戦略的優位分析

  1. 複数の戦略を組み合わせ,市場を総合的に判断し,信頼性が高くなる

  2. 単一の技術指標で発生する偽信号を排除する

  3. 逆転予測戦略は,短期的な逆転の機会を捉える

  4. チャンデは振動器が長期のトレンドを正確に予測している.

  5. ストキャスティック・オシレータの指標パラメータは調整可能で,適応性が強い

  6. 複数の分析方法を融合させ,さまざまな次元での取引機会を把握する

リスク分析

  1. 組合せ戦略は信頼性を高めても,信号発生頻度は低下する.

  2. 戦略のパラメータを同時に最適化する必要があります.

  3. 逆転の時期が把握できないため,損失の危険性がある

  4. 線形回帰予測は,価格の急激な変動のある市場には適用されない

  5. ストキャスティック・オシレータから外れている株価に注目する

  6. 記録が不十分で,実態は疑わしい

戦略最適化の方向性

  1. ストキャスティックオシレータのパラメータを最適化し,K線とD線周期を短縮

  2. 線形回帰周期を調整し,より多くの周期パラメータをテストする

  3. 単一損失を減らすために ストップ・ロスを増やす

  4. ポジション開設論理を修正し,ストキャスティックオシレータが超買い超売り領域に完全に入るまで待つ

  5. 取引品種の統計分析を追加

  6. MACDなどの他の指標と組み合わせることで,より多くの次元を判断できます.

要約する

この戦略は,複数の分析方法を総合的に適用し,信号の質を組み合わせて改善し,短期逆転の発見と大トレンドの判断の両面を兼ねながら,より包括的な取引機会を捉えることができる.しかし,実盤効果に注意し,パラメータを適切に調整する必要があります.この戦略の考え方は,より多くの指標と戦略の組み合わせに拡張され,実際の取引操作を導くために使用できます.全体的に,この戦略は,一定の革新性と参照価値を持っています.

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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 08/08/2019
// This is combo strategies for get a cumulative signal. 
//
// 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.
//
// Second strategy
// The Chande Forecast Oscillator developed by Tushar Chande The Forecast 
// Oscillator plots the percentage difference between the closing price and 
// the n-period linear regression forecasted price. The oscillator is above 
// zero when the forecast price is greater than the closing price and less 
// than zero if it is below.
//
// 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

ChandeForecastOscillator(Length, Offset) =>
    pos = 0
    xLG = linreg(close, Length, Offset)
    xCFO = ((close -xLG) * 100) / close
    pos := iff(xCFO > 0, 1,
           iff(xCFO < 0, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Chande Forecast Oscillator", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthCFO = input(14, minval=1)
Offset = input(0)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posChandeForecastOscillator = ChandeForecastOscillator(LengthCFO, Offset)
pos = iff(posReversal123 == 1 and posChandeForecastOscillator == 1 , 1,
	   iff(posReversal123 == -1 and posChandeForecastOscillator == -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 ? #b50404: possig == 1 ? #079605 : #0536b3 )