TSIとHMACCI指標に基づく二国間裁定戦略


作成日: 2024-01-23 11:26:14 最終変更日: 2024-01-23 11:26:14
コピー: 0 クリック数: 575
1
フォロー
1617
フォロワー

TSIとHMACCI指標に基づく二国間裁定戦略

概要

この戦略は,TSIと改良CCI指標の双方向取引シグナルを融合し,より安定した継続的な利益を追求するために,ブレーカー方式で頻繁にポジションを平らにする.重要な論理は,TSI指標の快慢均線金叉と死叉であり,HMACCI指標の多空シグナルラインと組み合わせて,市場の買賣方向を判断する.ポジション開設条件を制限することによってリスクを制御し,同時に止損と止まりの論理を設定する.

戦略原則

この戦略は主にTSIとHMACCIの2つの指標の組み合わせに基づいています.

TSI指標は,買入信号を判断するために,迅速な平均線と遅い平均線を構成しています. 速い線が,下から上へと遅い線を突破すると,買入信号として,逆に売り信号となります. これにより,市場の変化の傾向をより敏感に捉えることができます.

HMACCI指数は,伝統的なCCI指数に基づいて,Hull移動平均を使用し,価格そのものを置き換えて,部分的なノイズを波して,超買超売区間を判断します.超買超売区間は,TSI指数の信号方向を再び確認できます.

戦略の鍵となる論理は,これらの2つの指標の判断結果を組み合わせ,誤った信号をフィルターするための特定の追加条件を設定することです.例えば,K線の前の一つの閉塞価格と複数の周期前の最高価格最低価格を調査し,反転信号の質を制御します.

ポジション開設に関しては,条件が満たされれば,K線が閉店するたびに市場価格でポジションを開設し,同時に空白を多めにします.これにより,より安定した利益を得ることができますが,スレジのリスクを担う必要があります.

ストップ・ストップ・ロスの側面では,浮動ストップと利潤の全平仓が設定されている.これは,一方的な取引のリスクを十分にコントロールできる.

戦略的優位性

これは比較的安定で信頼性の高い高頻率アベरेज戦略である.主な利点は以下の通りである.

  1. ダブル指標の組み合わせにより,誤信号を効果的に回避できます.
  2. K線ごとにポジションを開設し,頻繁にリバレッジ操作を行い,利益と損失の変動が平らになる
  3. 厳格なポジション開設ロジックとストップ・ロジックにより,リスクがコントロールされます.
  4. トレンドと反転判断の組み合わせで,誤差の許容率が高い
  5. 方向性のない好み,あらゆる種類の市場状況に適用される
  6. パラメータは空間的に調整され,異なる品種に最適化できます.

リスク分析

リスクは以下の通りです.

  1. 高周波取引による手数料の損失
  2. 競り合いに巻き込まれる可能性は 完全に避けられない
  3. パラメータを正しく設定しない場合,過激なフィールドへの入場が起こり得る.
  4. 短期的には,一方的な大きな損失を背負うのは困難です.

リスクは以下の方法で軽減できます.

  1. 倉庫開設頻度を適切に調整し,手数料の影響を軽減する
  2. 信号品質を保証する指標パラメータを最適化
  3. ストップ・ローズを上げても,利回りが減ります.
  4. 異なる品種のパラメータ設定をテストする

最適化の方向

この戦略は改善の余地があり,以下の方向に発展しています.

  1. 周期,長さなどのパラメータの最適化とテスト
  2. MACD,BOLLなどの様々な指標の組み合わせを試す
  3. ストック開設ロジックを修正し,より厳しいフィルタリング条件を設定します.
  4. ストップ・ストップ・ストップ戦略を最適化し,ダイナミックで突破的なストップを実現する
  5. 機械学習の方法を試し,より安定したパラメータ範囲を探します.
  6. 取引品種と期間をテストする
  7. トレンド判断の指標を組み合わせて,急激な動きを避けるために

要約する

この戦略は,全体として,安定し,信頼性があり,誤差率が高い二面的な利戦略である.これは,トレンド判断と逆転指標を融合し,頻繁な二面的な開設ポジションによって安定した収益を得ている.同時に,戦略自体は,強力な最適化スペースと潜在性を有しており,深入の研究に値する高周波取引考え方である.

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

// This source code is subject to the terms of the suns bipolarity
//©SeaSide420
//@version=4
strategy(title="TSI HMA CCI", default_qty_type=strategy.cash,default_qty_value=1000,commission_type=strategy.commission.percent,commission_value=0.001)
long = input(title="TSI Long Length", type=input.integer, defval=25)
short = input(title="TSI Short Length", type=input.integer, defval=25)
signal = input(title="TSI Signal Length", type=input.integer, defval=13)
length = input(33, minval=1, title="HMACCI Length")
src = input(open, title="Price Source")
ld = input(50, minval=1, title="Line Distance")
CandlesBack = input(8,minval=1,title="Candles Look Back")
StopLoss= input(3000,minval=1, title="Stop Loss")
TargetProfitAll= input(3000,minval=1, title="Target Profit Close All")
FromMonth=input(defval=1,title="FromMonth",minval=1,maxval=12)
FromDay=input(defval=1,title="FromDay",minval=1,maxval=31)
FromYear=input(defval=2020,title="FromYear",minval=2020)
ToMonth=input(defval=1,title="ToMonth",minval=1,maxval=12)
ToDay=input(defval=1,title="ToDay",minval=1,maxval=31)
ToYear=input(defval=9999,title="ToYear",minval=2017)
start=timestamp(FromYear,FromMonth,FromDay,00,00)
finish=timestamp(ToYear,ToMonth,ToDay,23,59)
window()=>true
ul = (ld)
ll = (ld-ld*2)
ma = hma(src, length)
cci = (src - ma) / (0.015 * dev(src, length))
price = close
double_smooth(src, long, short) =>
	fist_smooth = ema(src, long)
	ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)*10
tsi_value2=ema(tsi_value/10, signal)*10
cc = color.white
ct = color.new(color.gray, 90)
if cci<ll or cci[1]<ll
    cc:=color.red
if cci>ul or cci[1]>ul
    cc:=color.green
if cci<ul and cci>ll
    cc:=color.new(color.yellow, 90)
ccc = color.white
if cci>ul
    ccc:=color.green
if cci<cci[1] and cci<ul and cci>ll
    ccc:=color.red
if cci<ll
    ccc:=color.red
if cci>cci[1] and cci>ll and cci<ul
    ccc:=color.green
tsiplot= plot(tsi_value, color=color.lime)
tsiplot2=plot(tsi_value2, color=color.red)    
colorchange2 =tsi_value>tsi_value2?color.lime:color.orange
fill(tsiplot, tsiplot2, color=colorchange2, title="TSIBackground", transp=50)
band1 = hline(ul, "Upper Band 1", color=ct, linestyle=hline.style_dashed)
band0 = hline(ll, "Lower Band 1", color=ct, linestyle=hline.style_dashed)
fill(band1, band0, color=cc, title="MidBandBackground", transp=0)
band2 = hline(ul, "Upper Band 2", color=ct, linestyle=hline.style_dashed)
band3 = hline(ll, "Lower Band 2", color=ct, linestyle=hline.style_dashed)
cciplot2 = plot(cci, "CCIvHMA 2", color=color.black, transp=0, linewidth=5)
cciplot = plot(cci, "CCIvHMA", color=ccc, transp=0, linewidth=3)
hline(0, title="Zero")
hline(420, title="420")
hline(-420, title="-420")
fill(cciplot, cciplot2, color=ccc, title="CCIBackground", transp=0)
LongCondition=cci>cci[1] and cci>ll and src>src[CandlesBack] and tsi_value>tsi_value2
ShortCondition=cci<cci[1] and cci<ul and src<src[CandlesBack] and tsi_value<tsi_value2
plotshape(LongCondition, title="BUY", style=shape.circle, location=location.top, color=color.green)
plotshape(ShortCondition, title="SELL", style=shape.circle, location=location.top, color=color.red)
if  strategy.openprofit>TargetProfitAll
    strategy.close_all(when=window(),comment="close all profit target")
if LongCondition and strategy.openprofit>-1
    strategy.order("BUY", strategy.long,when=window())
if ShortCondition and strategy.openprofit>-1
    strategy.order("SELL", strategy.short,when=window())
strategy.exit("SL exit a sell", "SELL", loss = StopLoss,when=window())     
strategy.exit("SL exit a buy", "BUY", loss = StopLoss,when=window())