二重移動平均反転とピボットポイントの組み合わせ戦略


作成日: 2024-01-16 15:48:44 最終変更日: 2024-01-16 15:48:44
コピー: 2 クリック数: 612
1
フォロー
1617
フォロワー

二重移動平均反転とピボットポイントの組み合わせ戦略

概要

この戦略は,123形状回転戦略と枢軸ポイント戦略を組み合わせて,より高い勝利率を得ることを目的としています.123形状回転戦略は,トレンドの逆転点を判断し,枢軸ポイント戦略は,重要なサポートと抵抗点を決定します.両者は組み合わせて,トレンドを捉え,特定の入場と出場価格を決定することができます.

戦略原則

123 形を逆戻りする戦略

この戦略は,ランダムな指標に基づいてトレンドの逆転点を判断する.具体的には以下の通りです. 閉盤価格が前閉盤価格より2日連続で低い場合,そして9日連続でSTO指数が50未満の場合,多額化します.閉盤価格が前閉盤価格より2日連続で高い場合,そして9日連続でSTO指数が50以上の場合,空白化します.

中枢戦略

この戦略は,前日の最高価格,最低価格,閉店価格に基づいて3つのサポートラインと3つのレジスタンスラインを計算します. 中心点= (最高+最低+終盤) / 3 1 は 2 に等しい.*中心地 - 最高 抵抗は1=2です中心地 - 最低 サポート2=中枢点- (抵抗1-サポート1) 阻力2=中心点+[[阻力1-支柱1) サポート3はマイナス2です.(最高 - 中心点)
抵抗3=最大+2*(中央のポイント - 最低) サポートとレジスタンス位置によって判断して入場と出場する.

戦略的優位性

  1. 2つの異なるタイプの戦略を組み合わせて,トレンドの逆転を判断し,特定の価格点をロックすることができ,勝利率が高くなります.
  2. 123形状戦略は,短期的なトレンドの転換点を判断するのに有効です.
  3. 枢軸戦略は,キーサポートのレジスタンス位のフィルタリングを偽突破に利用できます.

リスクとフージュ

  1. 双ランダム指数には遅延があり,短線反転を逃す可能性があります.
  2. 枢軸は100%機能していないので, 突破口があるかもしれない.
  3. 適切なパラメータを調整するか,他の指標の組み合わせでリスクをカバーするために使用できます.

戦略最適化の方向性

  1. 異なるパラメータが戦略の効果に与える影響をテストできます
  2. 戦略の効果を高めるために,他の指標や形状と組み合わせて試すことができます.
  3. 機械学習アルゴリズムの動的最適化パラメータを組み合わせることができる

要約する

この戦略は,トレンド判断と重要な価格位を巧みに組み合わせて,トレンドの逆転点を判断するとともに,サポート抵抗フィルター信号を利用することができます.パラメータと戦略の組み合わせを最適化することで,効果をさらに向上させることができます.この戦略は,量化トレーダーによるさらなる研究と適用に値します.

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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 21/04/2021
// 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
// Pivot points simply took the high, low, and closing price from the previous period and 
// divided by 3 to find the pivot. From this pivot, traders would then base their 
// calculations for three support, and three resistance levels. The calculation for the most 
// basic flavor of pivot points, known as ‘floor-trader pivots’, along with their support and 
// resistance levels.
//
// 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


PP2(res,SellFrom,BuyFrom) =>
    pos = 0.0
    xHigh  = security(syminfo.tickerid,res, high)
    xLow   = security(syminfo.tickerid,res, low)
    xClose = security(syminfo.tickerid,res, close)
    vPP = (xHigh+xLow+xClose) / 3
    vS1 = 2*vPP - xHigh 
    vR1 = 2*vPP-xLow
    vS2 = vPP - (vR1 - vS1)
    vR2 = vPP + (vR1 - vS1)
    vS3 = xLow - 2 * (xHigh - vPP)
    vR3 = xHigh + 2 * (vPP - xLow) 
    S =  iff(BuyFrom == "S1", vS1, 
          iff(BuyFrom == "S2", vS2,
           iff(BuyFrom == "S3", vS3,0)))
    B =  iff(SellFrom == "R1", vR1, 
          iff(SellFrom == "R2", vR2,
           iff(SellFrom == "R3", vR3,0)))
    pos := iff(close > B, 1,
             iff(close < S, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Pivot Point V2)", shorttitle="Combo", overlay = true)
line1 = input(true, "---- 123 Reversal ----")
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
line2 = input(true, "---- Pivot Point V2 ----")
res = input(title="Resolution", type=input.resolution, defval="D")
SellFrom = input(title="Sell from ", defval="R1", options=["R1", "R2", "R3"])
BuyFrom = input(title="Buy from ", defval="S1", options=["S1", "S2", "S3"])
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posPP2 = PP2(res,SellFrom,BuyFrom)
pos = iff(posReversal123 == 1 and posPP2 == 1 , 1,
	   iff(posReversal123 == -1 and posPP2 == -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 )