この戦略は,複数のEMAの斜率方向と交差関係を用いてトレンドの方向を判断し,非停止のトレンド取引を実現する.それは常に看板または看板のポジションを保持することができる.
3組の異なる周期のEMAを計算し,それぞれ速,中,緩慢のEMAである.
速速EMAが中速EMAの上を通過し,中速EMAの傾斜が正し,多信号を生成する.
速速EMAが中速EMAの下を通過し,中速EMAの傾斜が負の方向に転じると空白信号が生成される.
価格が上昇する時に多めに,下がる時に空っぽにする.
EMAの傾き関係は,トレンドの変化を反映している. 価格とEMAの交差確認入場.
複数のEMAグループがトレンドの方向を正確に判断する.
EMAはトレンドと振動を合理的に区別する.
平均線斜率の変化は,トレンドの変化を予告する.
価格の交差が再確認され,偽突破は回避されます.
市場を動かすには,常にポジションを保ち,トレンドの機会を十分に捉える必要があります.
EMAだけで,震動の状況でポジションを保有するリスクは大きい.
EMAのパラメータは正しく設定されず,ターニングポイントを逃している可能性があります.
予想外で,今度は,強弱なトレンドを判断できず,早めに逆転するかもしれない.
単一損失を効果的にコントロールできない.
異なるEMAパラメータの組み合わせをテストし,より優れているパラメータを見つけます.
MACDなどの他の指標を追加します.
リスクコントロールのストップ・メカニズムを追加
弱気なトレンドを評価し,早すぎる逆転を避ける.
資金管理の最適化,ポジションの規模調整
トレンドが揺れ動いた時に取引を一時停止する.
この戦略は,EMAの複数の組み合わせ判断トレンドを利用する考えが妥当である。しかし,EMAのみに依存する特定の盲点があり,最適化スペースが広く,より多くの指標判断を導入できる。また,安定性を高めるためにリスク制御機構を組み込む必要もある。全体的に,フレームワーク設計科学は,継続的な改善によって,より強いトレンド取引戦略に成長する見込みがある。
/*backtest
start: 2023-08-20 00:00:00
end: 2023-09-19 00:00:00
period: 6h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("EMA Slope + EMA Cross Strategy (by ChartArt)", shorttitle="CA_-_EMA_slope_cross", overlay=true)
// ChartArt's EMA Slope + EMA Cross Strategy
//
// Version 1.0
// Idea by ChartArt on March 10, 2018.
//
// This strategy uses divergences between
// three moving averages and their slope
// directions as well as crosses between
// the price and the moving averages
// to switch between long/short positions.
//
// The strategy is non-stop in the market
// and always either long or short.
//
// In addition the moving averages are colored
// depending if they are trending up or down.
//
// List of my work:
// https://www.tradingview.com/u/ChartArt/
// Input
price = input(close)
MA1_Length = input(2,step=1, title="EMA 1 Length")
MA2_Length = input(4,step=1, title="EMA 2 Length")
MA3_Length = input(20,step=1, title="EMA 3 Length")
switch1=input(true, title="Show Bar Color?")
switch2=input(true, title="Show Moving Averages?")
// Calculation
MA1 = ema(price, MA1_Length)
MA2 = ema(price, MA2_Length)
MA3 = ema(price, MA3_Length)
// Strategy
long = crossunder(price, MA3) or ( change(price)<0 and change(MA1)<0 and crossunder(price,MA1) and change(MA2)>0 )
short = crossover(price, MA3) or ( change(price)>0 and change(MA1)>0 and crossover(price,MA1) and change(MA2)<0 )
if long
strategy.entry("Long", strategy.long, comment="Long")
if short
strategy.entry("Short", strategy.short, comment="Short")
// Strategy Alert
alertcondition(long, title='EMA Slope + EMA Cross Strategy, Long Alert', message='Go Long!')
alertcondition(short, title='EMA Slope + EMA Cross Strategy, Short Alert', message='Go Short!')
// MA trend bar color
up = change(MA2)>0 and change(MA3)>0
dn = change(MA2)<0 and change(MA3)<0
bar_color = up?green:dn?red:blue
barcolor(switch1?bar_color:na)
// MA trend output color
MA2_color = change(MA2)>0?lime:change(MA2)<0?red:blue
MA3_color = change(MA3)>0?lime:change(MA3)<0?red:blue
// MA output
EMA2 = plot(switch2?MA2:na, title="EMA 2", style=linebr, linewidth=2, color=MA2_color)
EMA3 = plot(switch2?MA3:na, title="EMA 3", style=linebr, linewidth=4, color=MA3_color)
fill(EMA2, EMA3, color=silver, transp=50)
//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)