ゴールデンクロス戦略

作者: リン・ハーンチャオチャン開催日:2023年9月15日 15:50:20
タグ:

戦略の概要

ゴールデンクロス戦略は,速いEMAが遅いSMAを超えるとロングシグナルを生成し,速いEMAが遅いSMAを下回るとロングシグナルを出します.この戦略は,二つの移動平均間の黄金のクロスオーバーを使用して長期トレンド逆転を捉えることを目的としています.

戦略の論理

  1. 短期トレンドを表す50期間の高速EMAを計算する.

  2. 長期トレンドを表す 200 期間の緩やかな SMA を計算する.

  3. 遅いSMAを超えると 長期上向きのトレンドの始まりを示します "ロング"です

  4. 急速なEMAが緩やかなSMAを下回ると,長期的に下向きの傾向が始まり,ロングポジションが閉じる.

クロスオーバーは,市場供給/需要動態と心理学の変化を表し,長期的なトレンドシフトのシグナルとして機能する. 速い線と遅い線の期間は,異なる資産と時間枠に基づいて調整することができます.

戦略 の 利点

  • トレンド転換の主要なポイントを特定するために二重移動平均を使用する

  • 金色の十字架は 明確なロングとアウトシグナルを形成します

  • 柔軟なパラメータ調整,様々な市場に対応

  • 簡単なバックテストとライブチューニング

  • 他の要因と組み合わせられる

危険 警告

  • 移動平均値の潜在的遅延

  • 偽のブレイクを防ぐ

  • 入口と出口の正確なタイミングを 判定するのは難しい

  • 内部の変動は傾向の損失を引き起こす可能性があります.

結論

ゴールデンクロス戦略は,高速と遅い移動平均のゴールデンクロスを比較することによって,長期的傾向の変化を判断し,広く使用されている長期戦略概念を形成する.パラメータは調整され,他の要因と組み合わせられ,異なる市場の戦略パフォーマンスを向上させることができます.


/*backtest
start: 2023-09-07 00:00:00
end: 2023-09-14 00:00:00
period: 2m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3


strategy("GoldenCross Strategy by Clefsphere",overlay=true, initial_capital=10000,default_qty_type=strategy.percent_of_equity,default_qty_value=100)

// testStartYear = input(2013, "Start Year")
// testStartMonth = input(3, "Start Month")
// testStartDay = input(1, "Start Day")
// testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

// testStopYear = input(2018, "Stop Year")
// testStopMonth = input(8, "Stop Month")
// testStopDay = input(5, "Stop Day")
// testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

// testPeriodBackground = input(title="Background", type=bool, defval=true)
// testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FF00 : na


sma1Period = input(50, "Fast EMA Buy")
sma2Period = input(200, "Slow SMA Buy")

// testPeriod() =>
//     time >= testPeriodStart and time <= testPeriodStop ? true : false

sma1val=sma(close,sma1Period)
sma2val=sma(close,sma2Period)


plot(sma1val,color=blue,linewidth=1)
plot(sma2val,color=orange,linewidth=1)

long=crossover(sma1val,sma2val)
short=crossunder(sma1val,sma2val)


// if testPeriod()
if long
    strategy.entry("buy",strategy.long)
    
if short
    strategy.close("buy")
        
plot(low,color= sma1val > sma2val ? green:  red,style=columns,transp=90,linewidth=1)


もっと