Triple EMA Crossover Breakout Strategi

Penulis:ChaoZhang, Tanggal: 2023-12-28
Tag:

img

Gambaran umum

Strategi Triple EMA Crossover Breakout menggunakan indikator rata-rata bergerak eksponensial tiga (EMA) untuk menentukan arah tren pasar dan memasuki titik-titik breakout tren.

Logika Strategi

Strategi ini didasarkan pada prinsip-prinsip berikut:

  1. Gunakan tiga EMA dengan periode yang berbeda (200 hari, 50 hari, 20 hari) untuk menentukan tren pasar utama, jangka menengah dan jangka pendek.

  2. Ketika EMA jangka pendek (20 hari) melintasi di atas EMA jangka menengah (50 hari), sinyal beli dihasilkan.

  3. Hanya ketika harga penutupan lilin kedua lebih tinggi (rendah) daripada harga tinggi (rendah) lilin sebelumnya, breakout dianggap dapat diandalkan.

  4. Atur stop loss dan ambil tingkat keuntungan untuk membatasi risiko di luar fluktuasi harga yang wajar.

Analisis Keuntungan

  1. Menggunakan beberapa EMA meningkatkan akurasi penilaian tren.

  2. Menyaring sinyal palsu dengan pola candlestick menghindari risiko perdagangan yang tidak perlu.

  3. Stop loss dan take profit mengendalikan kerugian perdagangan tunggal secara efektif.

Analisis Risiko

  1. Di pasar yang berbeda, EMA dapat menghasilkan sinyal palsu yang berlebihan dan gagal menentukan arah pasar.

  2. Sistem indikator tunggal memiliki kapasitas terbatas dalam situasi pasar yang kompleks.

  3. Ini mengabaikan biaya perdagangan yang dapat menyebabkan tidak menguntungkan di pasar dengan biaya tinggi.

Optimalisasi

  1. Memperkenalkan indikator lain seperti MACD dan KDJ untuk membentuk sistem gabungan dan meningkatkan akurasi penilaian.

  2. Mengoptimalkan parameter melalui backtesting untuk simbol tertentu dan kerangka waktu untuk membuat strategi lebih sesuai.

  3. Tambahkan volume perdagangan untuk menghindari sinyal palsu volume rendah.

Kesimpulan

Triple EMA Crossover Breakout Strategy memiliki logika yang jelas dan mudah dimengerti untuk menentukan tren pasar dan menemukan waktu masuk menggunakan EMA crossover.


/*backtest
start: 2022-12-21 00:00:00
end: 2023-12-27 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("GHG RETRACEMENT MODE 1", overlay=true)

entryLevel1 = input(0.5, "ENTRY LEVEL 1")
entryLevel2 = input(0.25, "ENTRY LEVEL 2")
entryLevel3 = input(0.0, "ENTRY LEVEL 3")

stopLevel = input(-0.35, "STOP LEVEL")
tpLevel = input(0.88, "TP LEVEL")
dontUseEma = input(false, "Don't Use EMA")


get_level(level, level100, level0) =>
    level * (level100 - level0) + level0

buySignal = close[2] < open[2] and close[1] > open[1] and close[0] > open[0] and high[0] > open[2] and high[1] < high[2]
sellSignal = close[2] > open[2] and close[1] < open[1] and close[0] < open[0] and low[0] < open[2] and low[1] > low[2]

if buySignal and (close[0] > ta.ema(close, 200) or dontUseEma)
    l = label.new(bar_index, na)
    entryPrice1 = get_level(entryLevel1, high[0], low[2])
    entryPrice2 = get_level(entryLevel2, high[0], low[2])
    entryPrice3 = get_level(entryLevel3, high[0], low[2])
    
    exitPrice = get_level(tpLevel, high[0], low[2])
    stopPrice = get_level(stopLevel, high[0], low[2])
    
    strategy.order("BUY 1", strategy.long, comment="BUY 1", limit=entryPrice1)
    strategy.exit("exit", "BUY 1", limit=high[0], stop=stopPrice)
    strategy.order("BUY 2", strategy.long, comment="BUY 2", limit=entryPrice2)
    strategy.exit("exit", "BUY 2", limit=high[0], stop=stopPrice)

    label.set_text(l, "Buy => " + str.tostring(close[2]) + "\nSL=> " + str.tostring(stopPrice) + "\nTP => " + str.tostring(exitPrice) )
    label.set_color(l, color.green)
    label.set_yloc(l, yloc.belowbar)
    label.set_style(l, label.style_label_up)
    
if sellSignal and (close[0] < ta.ema(close, 200) or dontUseEma)
    a = label.new(bar_index, na)
    entryPrice1 = get_level(entryLevel1, low[0], high[2])
    entryPrice2 = get_level(entryLevel2, low[0], high[2])
    entryPrice3 = get_level(entryLevel3, low[0], high[2])
    
    exitPrice = get_level(tpLevel, low[0], high[2])
    stopPrice = get_level(stopLevel,low[0], high[2])
    
    strategy.order("SELL 1", strategy.short, comment="SELL 1", limit=entryPrice1)
    strategy.exit("exit", "SELL 1", limit=low[0], stop=stopPrice) 
    strategy.order("SELL 2", strategy.short, comment="SELL 2", limit=entryPrice2)
    strategy.exit("exit", "SELL 2", limit=low[0], stop=stopPrice) 

    label.set_text(a,"Sell => " + str.tostring(close[2]) + "\nSL=> " + str.tostring(stopPrice) + "\nTP => " + str.tostring(exitPrice) )
    label.set_color(a, color.red)
    label.set_yloc(a, yloc.abovebar)
    label.set_style(a, label.style_label_down)
   


Lebih banyak