
多重平均線多頭トレンド戦略は,複数の異なる周期の指数移動平均 ((EMA) を基に判断を構成するトレンド追跡戦略である.これは,価格が10日間のEMAを突破し,他のより長い周期のEMA線が多頭並列を呈するときに多く行う.その後,8%の尾行ストロップを使用して利益をロックする.
この戦略は,10日,20日,50,100日,150日,200日の6つの異なる周期のEMA線を使用する.これらのEMA線は,市場の現在の周期段階を判断するために使用される.短期EMA線 (例えば10日線) がより長い周期のEMA線 (例えば20日,50日線) を穿越するときに,市場が多頭トレンドに入っていくマークアップ段階と見なされる.
戦略は,以下の条件を満たしたときに,多額のポジションを開きます.
余剰開設後,戦略は8%の追随ストップを使用して利益をロックする.つまり,株価が購入価格の8%を超えて戻らない限り,そのポジションを継続する.8%以上の引き戻しが発生すると,損失を停止する.
全体として,この戦略の核心構想は,多頭トレンドへの入り口を判定するために,EMAの複数のフィルター条件を使用し,利益をロックするために,ストップをフォローすることです.
この多重平均線多頭トレンド戦略には以下の主要な利点があります.
この戦略にはいくつかのリスクがあります.
上記のリスクに対して,EMAサイクルパラメータを適切に調整するか,または補助判断として他の指標を導入することによって,最適化および改善を行うことができます.
この戦略の特徴を考慮して,今後は以下のような点で最適化できる:
多重平均線多頭トレンド戦略は,全体としてより堅牢で信頼性の高いトレンド追跡戦略である.それは,トレンド判断とリスク管理の両方を兼ね備えている.パラメータ調整とアルゴリズム最適化による改善の余地が大きい.全体として,これは試用して研究する価値のある有効な戦略である.
/*backtest
start: 2023-01-15 00:00:00
end: 2024-01-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy('SirSeff\'s EMA Rainbow', overlay=true)
// Testing Start dates
testStartYear = input(2000, 'Backtest Start Year')
testStartMonth = input(1, 'Backtest Start Month')
testStartDay = input(1, 'Backtest Start Day')
testPeriodStart = timestamp(testStartYear, testStartMonth, testStartDay, 0, 0)
//Stop date if you want to use a specific range of dates
testStopYear = input(2100, 'Backtest Stop Year')
testStopMonth = input(12, 'Backtest Stop Month')
testStopDay = input(30, 'Backtest Stop Day')
testPeriodStop = timestamp(testStopYear, testStopMonth, testStopDay, 0, 0)
testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false
// Component Code Stop
//TSP
trailStop = input.float(title='Long Trailing Stop (%)', minval=0.0, step=0.1, defval=8) * 0.01
longStopPrice = 0.0
longStopPrice := if strategy.position_size > 0
stopValue = close * (1 - trailStop)
math.max(stopValue, longStopPrice[1])
else
0
//PLOTS
plot(series=strategy.position_size > 0 ? longStopPrice : na, color=color.new(color.red, 0), style=plot.style_linebr, linewidth=1, title='Long Trail Stop', offset=1, title='Long Trail Stop')
plot(ta.ema(close, 20))
plot(ta.ema(close, 50))
plot(ta.ema(close, 100))
plot(ta.ema(close, 150))
plot(ta.ema(close, 200))
//OPEN
longCondition = ta.ema(close, 10) > ta.ema(close, 20) and ta.ema(close, 20) > ta.ema(close, 50) and ta.ema(close, 100) > ta.ema(close, 150) and ta.ema(close, 150) > ta.ema(close, 200)
if longCondition and ta.crossover(close,ta.ema(close,10)) and testPeriod()
strategy.entry("BUY1", strategy.long)
if longCondition and ta.crossover(ta.ema(close,10),ta.ema(close,20)) and testPeriod()
strategy.entry("BUY2'", strategy.long)
//CLOSE @ TSL
if strategy.position_size > 0 and testPeriod()
strategy.exit(id='TSP', stop=longStopPrice)