
聖十字戦略 (Holy Grail Strategy) は,双均線システムとADX指標を組み合わせた量的な取引戦略である.これは,トレンドの方向と強さを認識し,トレンドが逆転したときに取引することを目的としている.
この戦略は,20日指数移動平均 ((EMA) とADX指標を同時に使用して入場時間を識別する.具体的には,以下の2つの状況で取引シグナルを発信する.
ADX値が30を下回ったとき (これはトレンドが弱いことを示している) と,価格が20日間のEMAを下から突破したときに,より多く行う.
ADX値が30以上で ((強いトレンドを示す) と,価格が上から20日間のEMAを突破すると空白する.
この戦略は,ADXがトレンドの強さと方向を判断し,移動平均のサポートとレジスタンスを組み合わせて,反転の機会を探していることがわかります. これはトレンドフォローと逆転取引の理念を融合しています.
聖十字策の最大の利点は,トレンドの方向と強さを同時に考慮し,偽突破を効果的に回避し,その結果,ストップダウスの確率を減らすことです.具体的には,この策には以下の利点があります.
この聖十字の戦略にはいくつかのリスクがあり,主に以下のような側面に重点を置いています.
上記のリスクを軽減するために,パラメータの組み合わせを最適化するために調整することも,単一の損失を制御するためにストップを設定することもできます.また,戦略を異なる品種と周期で反テストさせることも必要である.
イスラム教では,聖十字の戦略は,多くの点で最適化されています.
パラメータの調整や新しい指標の追加により,戦略の利潤率や勝利率が向上する可能性があります.しかし,あらゆる最適化は,その安定性を確保するために十分な反射が必要です.
全体として,聖十字戦略は,双均線とADX指標の優位性を組み合わせ,明確な取引ルールを使用してトレンドの転換を捕捉する.それは良い結果をもたらすだろう.しかし,トレーダーは,異なる市場環境に対応するためにパラメータの組み合わせとストップルルールを最適化する必要があります.さらに,改善しても,ストップを完全に回避することはできません.これは,すべての取引戦略が直面する困境です.
/*backtest
start: 2022-11-24 00:00:00
end: 2023-11-30 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("LAT Holy Grail v3", overlay=true)
/////////////TEST TIME ////////////////////////
testStartYear = input(2018, "Backtest Start Year")
testStartMonth = input(4, "Backtest Start Month")
testStartDay = input(15, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)
testStopYear = input(2018, "Backtest Stop Year")
testStopMonth = input(5, "Backtest Stop Month")
testStopDay = input(30, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)
// A switch to control background coloring of the test period
testPeriodBackground = input(title="Color Background?", type=bool, defval=true)
testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FF00 : na
bgcolor(testPeriodBackgroundColor, transp=97)
testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false
//////////////////////////////////////////////////////////////////////
myema= ema(close, 20)
plot(myema, color=green, title="eMA", linewidth=3)
//longCondition = (crossover(close, myema)) //and adx3 < target
//if (longCondition)
//strategy.entry("My Long Entry Id", strategy.long)
//shortCondition = (crossunder(close, myema)) //and adx3 > target
//if (shortCondition)
//strategy.entry("My Short Entry Id", strategy.short)
//////////////////////////////////////////////////////////
/////////////////////////////////////// DMI ///////////////////////////////////////////////
len3 = input(14, minval=1, title="DI Length") /////////////////////
lensig3 = input(14, title="ADX Smoothing", minval=1, maxval=50) ////////////////////
up3 = change(high) ///////////////////
down3 = -change(low) //////////////////
plusDM3 = na(up3) ? na : (up3 > down3 and up3 > 0 ? up3 : 0) /////////////////
minusDM3 = na(down3) ? na : (down3 > up3 and down3 > 0 ? down3 : 0) ////////////////
trur3 = rma(tr, len3) ///////////////
plus3 = fixnan(100 * rma(plusDM3, len3) / trur3) //////////////
minus3 = fixnan(100 * rma(minusDM3, len3) / trur3) /////////////
sum3 = plus3 + minus3 ////////////
adx3 = 100 * rma(abs(plus3 - minus3) / (sum3 == 0 ? 1 : sum3), lensig3) ///////////
//plot(plus3, color=green, style=circles, linewidth=2, title="+DI") //////////
//plot(minus3, color=red, style=circles, linewidth=2, title="-DI") /////////
plot(adx3, color=aqua, style=line, linewidth=3, title="ADX") ////////
target = input(30, title=" ADX Target Line") ///////
plot(target, color=yellow, title="ADX Target Line") //////
/////////////////////////////////////////////////////////////////////////////////////////////////
plot(hl2)
/////////////////////////////////////////////// eMA SIGNAL LINE ///////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////// HOLY GRAIL STRATEGY ///////////////////////////////////////////////////////////////////
if (adx3 <= target) and crossover(close, myema)
strategy.entry("HolyGrail", strategy.long, comment="Long")
if (adx3 >= target) and crossunder(close, myema)
strategy.entry("HolyGrail", strategy.short, comment="Short")