多期ストーカスティック戦略

作者: リン・ハーンチャオチャン,日付: 2024-02-29 12:11:23
タグ:

img

概要

戦略の論理

この戦略のコア指標はストカスティックK線とD線である.K線は最近の価格勢いを反映し,D線はK線の移動平均線である.それらの相対的位置と方向は価格動向と潜在的な逆転を決定することができる.

この戦略は,信号を確認しノイズをフィルタリングするために,2つのタイムフレームにわたるストキャスティック指標を使用する.より高いタイムフレームストキャスティックは全体的な傾向を定義し,現在のタイムフレームストキャスティックは時間エントリへの短期的な曲折点を特定する.

利点分析

この戦略は,複数のタイムフレームの指標と現在の勢いを組み合わせることで,市場の騒音を効果的にフィルタリングし,高確率で収益性の高い取引を捕捉することができます.主な利点は次のとおりです.

  1. より長いタイムフレームは,不必要なストップと損する取引を最小限に抑えるために,トレンドに沿った取引を保証します.
  2. 双重ストキャスト指標は信号の正確性を向上させ 誤った信号を減少させます

リスク分析

この戦略にはいくつかのリスクがあります.

  1. 突発的なトレンド逆転は,より高いタイムフレーム指標によって早期に捉えられず,遅い方向転換による損失を増やす可能性があります.タイムフレームパラメータは,十分なタイムリーな市場データを入手するために最適化する必要があります.
  2. 現在のタイムフレーム指標は過度に敏感になり,取引頻度とコストを増加させる可能性があります.

オプティマイゼーションの方向性

主な最適化方向は以下の通りである.

  1. 誤った信号を減らすために 現在のタイムフレームパラメータと 突破限界を調整します
  2. ストップ・ロスの戦略を組み込み,取引ごとにダウンサイドリスクを制御する.

結論


/*backtest
start: 2023-02-22 00:00:00
end: 2024-02-28 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy("MTF stochastic strategy", overlay=false,pyramiding=3,default_qty_type=strategy.percent_of_equity,default_qty_value=100,currency=currency.USD)
//
//this strategy is inspired to bobby thread in forexfactory forum
//
len = input(11, minval=1, title="Length for Main Stochastic") 
smoothK = input(3, minval=1, title="SmoothK for Main Stochastic")
smoothD = input(3, minval=1, title="SmoothD for Main Stochastic")
upLine = input(80, minval=50, maxval=90, title="Upper Line Value?")
lowLine = input(20, minval=10, maxval=50, title="Lower Line Value?")
trailStep=input(50,minval=10,title="Trialing step value")

// current stochastic calculation
k = sma(stoch(close, high, low, len), smoothK)
d = sma(k, smoothD)

//mtf stochastic calculation smoothed with period

mtfK= sma(stoch(close, high, low, len), smoothK*3)
mtfD= sma(k, smoothD*3)

plot(k,"current TF k",black,style=linebr)
plot(d,"current TF d",gray,style=linebr)
plot(mtfK,"MTF TF k",red,style=line)
plot(mtfD,"Multi TF d",green,style=line)
hline(upLine)
hline(50)
hline(lowLine)

longCondition = crossover(mtfK, 50) and k>50 and change(k,1)>0 and k>d and mtfK>mtfD
if (longCondition)
    strategy.entry("Lungo", strategy.long)

shortCondition = crossunder(mtfD, 50) and k<50 and change(k,1)<0 and k<d and mtfK<mtfD
if (shortCondition)
    strategy.entry("Corto", strategy.short)
    
exitlong=crossunder(mtfD, upLine)
exitshort=crossover(mtfK, lowLine)

if (exitlong)
    strategy.exit("Esci lungo","Lungo",trail_points=trailStep)
if (exitshort)
    strategy.exit("Esci corto","Corto",trail_points=trailStep)
    



もっと