この戦略は,複数の時間枠の移動平均の交差を利用して取引信号判断を行う. この戦略は,現在の時間枠でより長い時間枠の移動平均を観察して,より大きなトレンドの方向性を発見することができる. この戦略は,跨時間枠のトレンド追跡戦略に属している.
この戦略は,2つの移動平均を用いて,それぞれ現在の周期とより高い周期で計算する.
例えば 15分間の図で 20日線と50日線を計算すると:
15分20日線で日線50日線を横切るときは,多めに;15分20日線下で日線50日線を横切るときは,空いてください.
このようにして,現在の周期でより長い周期のトレンドを観察する効果が得られます. 策略は,移動平均の周期長さをカスタマイズすることもできます.
交差点は取引を警告する点状のマークを表示することもできます.
リスクを下げるには,以下の措置を講じます.
主なトレンドを正しく判断するために,より長い高周期平均線を保持する
他の技術指標を追加して信号をさらにフィルタリングする
均線周期パラメータを最適組合せに最適化
入場条件の適切な緩和,例えばK線形状の追加
この戦略は以下の点で改善できる:
異なる周期の組み合わせは,異なる品種に最適のマッチング組み合わせをもたらす
交差点の MACD の動きをチェックする
PostForm123の補足証拠に基づいて退出を決定する
短周期はより厳しいフィルタリング条件,長周期はより緩やかな条件を採用
異なる時間帯の市場特性が異なるため,パラメータの最適化が可能
この戦略は,複数の時間枠の均線の交差を観察してトレンドの方向を判断し,より大きなレベルのトレンドを発見する.これは,短期的なノイズを効果的に除し,Focus123123のより大きな動きのペースを与える.しかし,周期設定の困難さ,トレンド判断の遅れなどの問題もある.我々は,厳格な反射による最適化パラメータの組み合わせを,そして他の指標を加えてフィルタリングConfirmation123を改良する.同時に,市場フィードバックに基づいて,戦略システムを継続的に修正し,より安定して信頼性のあるものにするために,実地検証も必要である.
/*backtest
start: 2022-09-14 00:00:00
end: 2023-09-20 00:00:00
period: 7d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
//Run script on a long interval gives better result for e.g. 1 Day
//Plots The Majority of Moving Averages
//Defaults to Current Chart Time Frame --- But Can Be Changed to Higher Or Lower Time Frames
//2nd MA Capability with Show Crosses Feature
//study(title="CM_Ultimate_MA_MTF", shorttitle="CM_Ultimate_MA_MTF", overlay=true)
strategy("Stratergy CM_Ultimate_MA_MTF", shorttitle = "Stratergy CM_Ultimate_MA_MTF", overlay = true)
//,default_qty_type = strategy.percent_of_equity, default_qty_value=100.0, pyramiding=0)
//inputs
src = close
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? Uncheck Box Above", defval="D")
len = input(20, title="Moving Average Length - LookBack Period")
atype = input(1,minval=1,maxval=7,title="1=SMA, 2=EMA, 3=WMA, 4=HullMA, 5=VWMA, 6=RMA, 7=TEMA")
cc = input(true,title="Change Color Based On Direction?")
smoothe = input(2, minval=1, maxval=10, title="Color Smoothing - 1 = No Smoothing")
doma2 = input(false, title="Optional 2nd Moving Average")
len2 = input(50, title="Moving Average Length - Optional 2nd MA")
atype2 = input(1,minval=1,maxval=7,title="1=SMA, 2=EMA, 3=WMA, 4=HullMA, 5=VWMA, 6=RMA, 7=TEMA")
cc2 = input(true,title="Change Color Based On Direction 2nd MA?")
warn = input(false, title="***You Can Turn On The Show Dots Parameter Below Without Plotting 2nd MA to See Crosses***")
warn2 = input(false, title="***If Using Cross Feature W/O Plotting 2ndMA - Make Sure 2ndMA Parameters are Set Correctly***")
sd = input(false, title="Show Dots on Cross of Both MA's")
res = useCurrentRes ? timeframe.period : resCustom
//hull ma definition
hullma = wma(2*wma(src, len/2)-wma(src, len), round(sqrt(len)))
//TEMA definition
ema1 = ema(src, len)
ema2 = ema(ema1, len)
ema3 = ema(ema2, len)
tema = 3 * (ema1 - ema2) + ema3
avg = atype == 1 ? sma(src,len) : atype == 2 ? ema(src,len) : atype == 3 ? wma(src,len) : atype == 4 ? hullma : atype == 5 ? vwma(src, len) : atype == 6 ? rma(src,len) : tema
//2nd Ma - hull ma definition
hullma2 = wma(2*wma(src, len2/2)-wma(src, len2), round(sqrt(len2)))
//2nd MA TEMA definition
sema1 = ema(src, len2)
sema2 = ema(sema1, len2)
sema3 = ema(sema2, len2)
stema = 3 * (sema1 - sema2) + sema3
avg2 = atype2 == 1 ? sma(src,len2) : atype2 == 2 ? ema(src,len2) : atype2 == 3 ? wma(src,len2) : atype2 == 4 ? hullma2 : atype2 == 5 ? vwma(src, len2) : atype2 == 6 ? rma(src,len2) : tema
out = avg
out_two = avg2
out1 = security(syminfo.tickerid, res, out)
out2 = security(syminfo.tickerid, res, out_two)
ma_up = out1 >= out1[smoothe]
ma_down = out1 < out1[smoothe]
col = cc ? ma_up ? lime : ma_down ? red : aqua : aqua
col2 = cc2 ? ma_up ? lime : ma_down ? red : aqua : aqua
circleYPosition = out2
chk=col==red?1:0
if (not na(chk))
if (chk[1]==1 and chk==0)
strategy.entry("RsiLE", strategy.long, comment="RsiLE")
else
strategy.exit("RsiLE")
if (chk[1]==0 and chk==1)
strategy.entry("RsiSE", strategy.short, comment="RsiLE")
else
strategy.exit("RsiSE")
plot(out1, title="Multi-Timeframe Moving Avg", style=line, linewidth=4, color = col)
plot(doma2 and out2 ? out2 : na, title="2nd Multi-TimeFrame Moving Average", style=circles, linewidth=4, color=col2)
plot(sd and cross(out1, out2) ? circleYPosition : na,style=cross, linewidth=5, color=yellow)