逆転予測とオシレーターコンボ戦略

作者: リン・ハーンチャオチャン,日付: 2023年10月10日 10:39:44
タグ:

概要

この戦略は,より信頼性の高い取引信号を得るため,逆転と振動器戦略を組み合わせます.逆転予測戦略とチャンデ予測振動器戦略を組み込み,両戦略が同時購入または販売信号を生成するときに取引を実行します.

戦略の論理

  1. 逆転予測戦略

    • ストカストティックオシレーターを使用して,過剰購入と過剰販売の条件を特定します.

    • ストカスティックオシレーターが過剰購入または過剰販売レベルに達する間,価格が2バーを超える逆転を閉じるときに逆方向取引を行う

  2. チャンデ予報オシレーター戦略

    • 価格を予測するために線形回帰分析を使用する

    • オスイレーターは閉店価格と予測価格の割合差をグラフ化します.

    • 実際の価格が予測価格と大きく異なる場合,取引信号を生成する

  3. 戦略規則

    • 両方の戦略からの信号を同時に計算する

    • 両方の戦略が購入または販売に合意した場合にのみ実際の取引信号を生成します

    • 組み合わせは個々の戦略から誤った信号をフィルターし,信頼性を向上させる

利点分析

  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 )

もっと