動向平均値に基づく戦略をフォローする傾向

作者: リン・ハーンチャオチャン, 日付: 2023-11-27 15:57:15
タグ:

img

概要

これは移動平均値に基づいたトレンドフォロー戦略である. イチモク・クラウド指標を使用して,トレンド方向を決定し,200日移動平均値と組み合わせ,シグナルをフィルターし,トレンドを追跡する.

戦略原則

この戦略は,主にイチモク・クラウドの変換線とベースラインを使用してトレンド方向を判断する.変換線は9日間の中位価格平均で,ベースラインは26日間の中位価格平均である.変換線がベースラインの上を横切ると購入信号が生成され,下を横切ると販売信号が生成される.

この戦略は,シグナルをフィルタリングするために200日移動平均値も採用している. 閉じる価格が200日線を超える場合にのみ,購入信号が起動する.これはほとんどの偽信号をフィルタリングする.

出口側では,この戦略は単に,ベースラインの下を横断する変換線を閉じる信号として使用します.

利点分析

この戦略は,トレンド判断指標Ichimoku Cloudと長期トレンドフィルタリング指標200日線を組み合わせ,トレンドを効果的に追跡し,ほとんどの偽信号をフィルタリングすることができます. 中間値平均を使用することで,移動平均値に対する価格異常の影響が軽減されます.

この戦略は,移動平均値のみを使用するのと比べて,トレンドのターニングポイントをより良く把握し,ポジションを適時に調整することができます.これが最大の強みです.

リスク分析

この戦略は,主にイチモク・クラウドに依存してトレンド方向を決定し,それ自体も誤った信号を生む可能性があります.判断が不正確であれば,戦略は損失につながる可能性があります.

また,パラメータの設定が不適切である場合,戦略性能が低下する可能性があります.変換ラインパラメータが短すぎると,誤った信号が容易に形成されます.ベースラインパラメータが長すぎると,追跡効果が悪化します.バランスのためにパラメータ調節が必要です.

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

信号の質を改善するために他の指標を組み込むことを検討してください.例えば,KDJ指標は過買い/過売りエリアの信号をフィルターします.またはATR指標を使用してストップロスを設定します.

パラメータ側では,より敏感な取引信号のために変換ラインパラメータを5日または7日に調整するなど,より多くの組み合わせをテストします. バランス追跡のためにベースラインパラメータを約20日に変更することもテストします.

さらに,荒野の変動の影響を避けるために,特定の不安定な環境下で戦略を無効にする方法を検討してください.

結論

この戦略は,トレンド判断と長期フィルタリング指標の利点を統合し,中期および長期のトレンドを効果的に追跡することができる.一方,パラメータ設定とリスク管理対策も,誤った信号と変動の影響を減らすために継続的な最適化が必要です.全体として,戦略は適切なパフォーマンスと実際の取引のための実用的な価値を持っています.


/*backtest
start: 2023-10-27 00:00:00
end: 2023-11-26 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy(title="TK Cross > EMA200 Strat",  overlay=true)

ema200 = ema(close, 200)
conversionPeriods = input(9, minval=1, title="Conversion Line Periods"),
basePeriods = input(26, minval=1, title="Base Line Periods")
laggingSpan2Periods = input(52, minval=1, title="Lagging Span 2 Periods"),
displacement = input(26, minval=1, title="Displacement")

donchian(len) => avg(lowest(len), highest(len))

conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)

plot(conversionLine, color=#0496ff, title="Conversion Line", linewidth=3)
plot(baseLine, color=#991515, title="Base Line", linewidth=3)
plot(close, offset = -displacement, color=#459915, title="Lagging Span")

p1 = plot(leadLine1, offset = displacement, color=green,
 title="Lead 1")
p2 = plot(leadLine2, offset = displacement, color=red, 
 title="Lead 2")
fill(p1, p2, color = leadLine1 > leadLine2 ? green : red)

plot(ema200, color=purple, linewidth=4,title='ema200')
strategy.initial_capital = 50000

strategy.entry('tkcross', strategy.long, strategy.initial_capital / close, when=conversionLine>baseLine and close > ema200)
strategy.close('tkcross', when=conversionLine<baseLine)


start = input(2, minval=0, maxval=10, title="Start - Default = 2 - Multiplied by .01")
increment = input(2, minval=0, maxval=10, title="Step Setting (Sensitivity) - Default = 2 - Multiplied by .01" )
maximum = input(2, minval=1, maxval=10, title="Maximum Step (Sensitivity) - Default = 2 - Multiplied by .10")
sus = input(true, "Show Up Trending Parabolic Sar")
sds = input(true, "Show Down Trending Parabolic Sar")
disc = input(false, title="Start and Step settings are *.01 so 2 = .02 etc, Maximum Step is *.10 so 2 = .2")
//"------Step Setting Definition------"
//"A higher step moves SAR closer to the price action, which makes a reversal more likely."
//"The indicator will reverse too often if the step is set too high."

//"------Maximum Step Definition-----")
//"The sensitivity of the indicator can also be adjusted using the Maximum Step."
//"While the Maximum Step can influence sensitivity, the Step carries more weight"
//"because it sets the incremental rate-of-increase as the trend develops"

startCalc = start * .01
incrementCalc = increment * .01
maximumCalc = maximum * .10

sarUp = sar(startCalc, incrementCalc, maximumCalc)
sarDown = sar(startCalc, incrementCalc, maximumCalc)

colUp = close >= sarDown ? lime : na
colDown = close <= sarUp ? red : na

plot(sus and sarUp ? sarUp : na, title="Up Trending SAR", style=circles, linewidth=3,color=colUp)
plot(sds and sarDown ? sarDown : na, title="Up Trending SAR", style=circles, linewidth=3,color=colDown)





もっと