Dokumentasi

Panduan menggunakan AlertConnector

Dari memasang EA sampai sintaks lengkap setiap jenis order. Sudah punya akun? Panduan di dasbor mengisi data Anda sendiri dan menyertakan pembuat alert.

Daftar isi

Mulai cepat

Sekitar lima belas menit, dengan MetaTrader 5 di komputer Anda atau di VPS.

  1. 1
    Dapatkan Account ID, EA Token, dan webhook: klik “Mulai uji coba gratis” di beranda (tanpa daftar), atau buat akun MT5 di dasbor jika sudah punya lisensi.
  2. 2
    Pasang EA di MetaTrader 5 lalu tempel Account ID dan EA Token.
  3. 3
    Buat alert di TradingView dengan URL webhook dan isi sinyal.
  4. 4
    Uji dulu di akun demo, lalu periksa hasilnya di riwayat sinyal.

Memasang EA di MT5

  1. 1
    Di MT5 pilih File → Open Data Folder, salin file EA ke folder MQL5/Experts. Di jendela Navigator, klik kanan → Refresh.
  2. 2
    Buka Tools → Options → Expert Advisors, centang “Allow WebRequest for listed URL” dan tambahkan https://alertconnector.vercel.app. Tanpa ini EA tidak bisa menghubungi server.
  3. 3
    Seret EA ke satu grafik mana saja — satu EA menangani semua simbol. Tempel AccountId dan EaToken di tab Inputs.
  4. 4
    Nyalakan tombol Algo Trading di toolbar. Jika tab Experts di bawah menampilkan baris awal AlertConnector, EA sudah berjalan.

MetaTrader harus terbuka agar order masuk. Untuk berjalan seharian tanpa membiarkan komputer pribadi menyala, gunakan VPS Windows.

Membuat alert TradingView

  1. 1
    Buka jendela pembuatan alert (ikon jam weker) di grafik atau strategi.
  2. 2
    Tab Notifications: nyalakan Webhook URL dan tempel alamat seperti https://alertconnector.vercel.app/api/webhook/<Account ID>.
  3. 3
    Tab Message: hapus teks bawaan dan tempel sinyal JSON (lihat sintaks).
  4. 4
    Atur frekuensi pemicu sesuai strategi Anda, lalu simpan.

Webhook adalah fitur paket berbayar TradingView, dan akun TradingView Anda harus mengaktifkan verifikasi dua langkah.

Sintaks sinyal

Setiap sinyal adalah objek JSON. Nama kolom ditulis huruf kecil; angka ditulis tanpa tanda kutip.

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "buy",
  "volume": 0.05,
  "sl_pips": 30,
  "tp_pips": 60
}
KolomWajibArti
secretWajibWebhook Secret akun (dari dasbor). Tidak pernah disimpan di riwayat.
symbolWajibNama simbol persis seperti di Market Watch broker, misalnya XAUUSD, XAUUSDm. EA otomatis menampilkan simbol yang tersembunyi.
actionWajibSalah satu dari sembilan jenis order.
volumeOpsionalVolume dalam lot. Jika kosong, dipakai DefaultLot milik EA. EA membulatkan ke step lot broker serta menjaga batas minimum dan maksimum.
sl_price · sl_points · sl_pipsOpsional, pilih satuStop loss berupa harga, jarak dalam point, atau pip. Jika kosong, dipakai DefaultSl milik EA.
tp_price · tp_points · tp_pipsOpsional, pilih satuTake profit, aturannya sama dengan SL. Jika kosong, dipakai DefaultTp.
offset_pointsKhusus titik impasMenggeser SL ke harga masuk ditambah sejumlah point ke arah untung, untuk mengunci laba kecil. Default 0.

Satuan: points adalah langkah harga terkecil simbol; 1 pip = 10 point untuk semua simbol. Setiap SL (dan TP) hanya boleh satu bentuk — mengirim sl_price bersama sl_points akan ditolak.

Sembilan jenis order

Order modify, breakeven, dan close_all hanya memengaruhi posisi yang dibuka AlertConnector (dikenali lewat MagicNumber), pada simbol dan arah yang sama.

buy / sell

Membuka beli / jual di harga pasar.

Perlu: symbol; opsional volume, SL, TP.

{ "secret": "…", "symbol": "XAUUSD", "action": "buy", "volume": 0.05, "sl_pips": 30, "tp_pips": 60 }

close_all

Menutup semua posisi simbol itu yang dibuka AlertConnector. Order manual dan EA lain tidak tersentuh.

Perlu: symbol.

{ "secret": "…", "symbol": "XAUUSD", "action": "close_all" }

modify_sl_long / modify_sl_short

Menggeser SL semua posisi beli (long) atau jual (short) simbol itu.

Perlu: symbol dan salah satu sl_price / sl_points / sl_pips.

{ "secret": "…", "symbol": "EURUSD", "action": "modify_sl_long", "sl_price": 1.085 }

modify_tp_long / modify_tp_short

Menggeser TP semua posisi beli atau jual simbol itu.

Perlu: symbol dan salah satu tp_price / tp_points / tp_pips.

{ "secret": "…", "symbol": "EURUSD", "action": "modify_tp_short", "tp_points": 400 }

breakeven_long / breakeven_short

Menggeser SL posisi beli atau jual ke harga masuknya (titik impas).

Perlu: symbol; opsional offset_points.

{ "secret": "…", "symbol": "BTCUSD", "action": "breakeven_long", "offset_points": 50 }

Field mana untuk aksi mana

Fieldbuy · sellbuy_limit · …_stopclose_*cancel_pending*modify_sl_*modify_tp_*breakeven_*
secretwajibwajibwajibwajibwajibwajibwajib
symbolwajibwajibwajibwajibwajibwajibwajib
actionwajibwajibwajibwajibwajibwajibwajib
volume · risk_percent · risk_moneyopsional, satu jenisopsional, satu jenis—————
price—wajib—————
stoplimit_price—wajib—————
expiry_minutes—opsional—————
sl_price · sl_points · sl_pipsopsional, satu jenisopsional, satu jenis——wajib, satu jenis——
tp_price · tp_points · tp_pipsopsional, satu jenisopsional, satu jenis———wajib, satu jenis—
close_oppositeopsional——————
close_percent——opsional————
offset_pointsopsionalopsional————opsional
be_trigger_pointsopsionalopsional—————
trail_points · trail_trigger_points · trail_step_pointsopsionalopsional—————
max_spread_pointsopsional——————
commentopsionalopsional—————

stoplimit_price: buy_stop_limit · sell_stop_limit (Hanya MetaTrader 5.)

1 pip = 10 poin di semua simbol. Jarak dalam poin/pip diukur dari harga saat ini (dari harga order untuk order tertunda).

Muat contoh siap pakai…

Order pasar

buy · BTCUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "buy"
}

sell · 0.05 lot · XAUUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "sell",
  "volume": 0.05
}

buy · SL/TP poin · 0.01 lot · BTCUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "buy",
  "volume": 0.01,
  "sl_points": 50000,
  "tp_points": 100000
}

sell · SL/TP pip · 0.1 lot · EURUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "EURUSD",
  "action": "sell",
  "volume": 0.1,
  "sl_pips": 20,
  "tp_pips": 40
}

buy · SL/TP harga · 0.02 lot · XAUUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "buy",
  "volume": 0.02,
  "sl_price": 2030.5,
  "tp_price": 2070
}

sell · SL/TP harga · 0.1 lot · GBPUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "GBPUSD",
  "action": "sell",
  "volume": 0.1,
  "sl_price": 1.2765,
  "tp_price": 1.2615
}

buy · SL/TP pip · 1% · XAUUSD

EA menghitung lot dari jarak SL, sehingga jika SL tersentuh kerugiannya tepat sebesar ini.

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "buy",
  "risk_percent": 1,
  "sl_pips": 30,
  "tp_pips": 60
}

sell · SL harga · $50 · EURUSD

EA menghitung lot dari jarak SL, sehingga jika SL tersentuh kerugiannya tepat sebesar ini.

{
  "secret": "<Webhook Secret>",
  "symbol": "EURUSD",
  "action": "sell",
  "risk_money": 50,
  "sl_price": 1.0872
}

buy · SL pip · 0.01 lot · XAUUSD

close_opposite: true menutup sisi berlawanan dulu, jadi satu alert membalik posisi.

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "buy",
  "volume": 0.01,
  "close_opposite": true,
  "sl_pips": 30
}

buy · SL poin · 0.01 lot · BTCUSD

EA mengelola SL sendiri: impas setelah be_trigger_points, lalu mengikuti harga dengan jarak trail_points.

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "buy",
  "volume": 0.01,
  "sl_points": 50000,
  "be_trigger_points": 30000,
  "offset_points": 500,
  "trail_points": 40000,
  "trail_trigger_points": 60000,
  "trail_step_points": 1000
}

sell · TP pip · 0.1 lot · USDJPY

{
  "secret": "<Webhook Secret>",
  "symbol": "USDJPY",
  "action": "sell",
  "volume": 0.1,
  "tp_pips": 50,
  "max_spread_points": 30,
  "comment": "breakout"
}

Order tertunda

buy_limit · SL/TP pip · 0.01 lot · XAUUSD

Order menunggu di "price": buy_limit dan sell_stop di bawah pasar, sell_limit dan buy_stop di atas.

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "buy_limit",
  "price": 2030,
  "volume": 0.01,
  "sl_pips": 50,
  "tp_pips": 100
}

sell_limit · SL harga · TP poin · 0.1 lot · EURUSD

Order menunggu di "price": buy_limit dan sell_stop di bawah pasar, sell_limit dan buy_stop di atas.

{
  "secret": "<Webhook Secret>",
  "symbol": "EURUSD",
  "action": "sell_limit",
  "price": 1.0875,
  "volume": 0.1,
  "sl_price": 1.0905,
  "tp_points": 300,
  "expiry_minutes": 240
}

buy_stop · SL poin · 0.5% · BTCUSD

Order menunggu di "price": buy_limit dan sell_stop di bawah pasar, sell_limit dan buy_stop di atas.

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "buy_stop",
  "price": 63500,
  "risk_percent": 0.5,
  "sl_points": 40000
}

sell_stop · SL/TP pip · 0.1 lot · GBPUSD

Order menunggu di "price": buy_limit dan sell_stop di bawah pasar, sell_limit dan buy_stop di atas.

{
  "secret": "<Webhook Secret>",
  "symbol": "GBPUSD",
  "action": "sell_stop",
  "price": 1.269,
  "volume": 0.1,
  "sl_pips": 25,
  "tp_pips": 50,
  "expiry_minutes": 60
}

buy_stop_limit · SL pip · 0.01 lot · XAUUSD

Hanya MetaTrader 5.

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "buy_stop_limit",
  "price": 2050,
  "stoplimit_price": 2048,
  "volume": 0.01,
  "sl_pips": 40
}

sell_stop_limit · TP pip · 0.1 lot · EURUSD

Hanya MetaTrader 5.

{
  "secret": "<Webhook Secret>",
  "symbol": "EURUSD",
  "action": "sell_stop_limit",
  "price": 1.082,
  "stoplimit_price": 1.0825,
  "volume": 0.1,
  "tp_pips": 30
}

Tutup

close_all · BTCUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "close_all"
}

close_long · XAUUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "close_long"
}

close_short · 50% · EURUSD

close_percent hanya menutup sebagian tiap posisi; sisanya tetap terbuka.

{
  "secret": "<Webhook Secret>",
  "symbol": "EURUSD",
  "action": "close_short",
  "close_percent": 50
}

close_all · *

"symbol": "*" berlaku untuk semua simbol yang ditradingkan EA ini.

{
  "secret": "<Webhook Secret>",
  "symbol": "*",
  "action": "close_all"
}

Batalkan tertunda

cancel_pending · XAUUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "cancel_pending"
}

cancel_pending_long · BTCUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "cancel_pending_long"
}

cancel_pending_short · *

"symbol": "*" berlaku untuk semua simbol yang ditradingkan EA ini.

{
  "secret": "<Webhook Secret>",
  "symbol": "*",
  "action": "cancel_pending_short"
}

Geser SL / TP

modify_sl_long · SL harga · XAUUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "modify_sl_long",
  "sl_price": 2035
}

modify_sl_long · SL poin · BTCUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "modify_sl_long",
  "sl_points": 30000
}

modify_sl_short · SL pip · EURUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "EURUSD",
  "action": "modify_sl_short",
  "sl_pips": 15
}

modify_tp_long · TP harga · XAUUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "modify_tp_long",
  "tp_price": 2080
}

modify_tp_long · TP pip · USDJPY

{
  "secret": "<Webhook Secret>",
  "symbol": "USDJPY",
  "action": "modify_tp_long",
  "tp_pips": 60
}

modify_tp_short · TP poin · EURUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "EURUSD",
  "action": "modify_tp_short",
  "tp_points": 400
}

Impas

breakeven_long · BTCUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "BTCUSD",
  "action": "breakeven_long"
}

breakeven_short · XAUUSD

{
  "secret": "<Webhook Secret>",
  "symbol": "XAUUSD",
  "action": "breakeven_short",
  "offset_points": 50
}

Variabel TradingView

buy · SL/TP pip · 0.01 lot

Simbol mengikuti chart tempat alert dibuat.

{
  "secret": "<Webhook Secret>",
  "symbol": "{{ticker}}",
  "action": "buy",
  "volume": 0.01,
  "sl_pips": 30,
  "tp_pips": 60
}

strategy

Untuk alert strategy: arah dan ukuran diambil dari strategy. Pastikan jumlah kontrak strategy cocok dengan lot broker Anda.

{
  "secret": "<Webhook Secret>",
  "symbol": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "volume": {{strategy.order.contracts}},
  "close_opposite": true
}

modify_sl_long · SL harga

Untuk alert indikator: level SL diambil dari plot pertama skrip Anda.

{
  "secret": "<Webhook Secret>",
  "symbol": "{{ticker}}",
  "action": "modify_sl_long",
  "sl_price": {{plot_0}}
}

buy_limit · SL pip · 0.01 lot

Order menunggu di "price": buy_limit dan sell_stop di bawah pasar, sell_limit dan buy_stop di atas.

{
  "secret": "<Webhook Secret>",
  "symbol": "{{ticker}}",
  "action": "buy_limit",
  "price": {{low}},
  "volume": 0.01,
  "sl_pips": 30
}

Variabel TradingView

TradingView mengganti variabel di dalam kurung kurawal ganda sebelum mengirim, jadi satu alert bisa dipakai di banyak grafik:

{
  "secret": "<Webhook Secret>",
  "symbol": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "volume": 0.01
}

{{ticker}} adalah simbol grafik. Untuk alert strategi, {{strategy.order.action}} menghasilkan buy atau sell. Jika nama simbol di TradingView berbeda dengan broker, tulis langsung nama broker alih-alih memakai {{ticker}}.

Pengaturan EA

Atur di tab Inputs saat memasang EA ke grafik.

PengaturanDefaultFungsi
AccountId—Account ID dari dasbor (atau panel uji coba).
EaToken—EA Token pasangan Account ID. Jika token salah, EA berhenti memanggil server dan memberi tahu di tab Experts.
ServerBaseUrlhttps://alertconnector.vercel.appAlamat server. Tidak perlu diubah.
CheckIntervalSeconds1Berapa detik sekali EA menanyakan server (minimal 1).
DefaultLot0.01Volume yang dipakai jika sinyal tidak menyertakan volume.
MagicNumber20260816Tanda order milik EA. close_all dan modify hanya memengaruhi posisi dengan tanda ini.
MaxOpenPositions20Jumlah maksimal posisi terbuka sekaligus (0 = tanpa batas). Lewat dari itu, order baru ditolak.
DefaultUnitPointsSatuan DefaultSl dan DefaultTp.
DefaultSl / DefaultTp0SL / TP default jika sinyal tidak menyertakannya (0 = tidak dipasang).
RequireStopLossfalseJika aktif, semua order buka tanpa SL ditolak.
OnlyImproveStopLossfalseJika aktif, perubahan SL hanya boleh ke arah mengurangi risiko.

Batasan & perlindungan

  • Batas 60 detik: sinyal yang belum diambil EA setelah 60 detik diabaikan, tidak pernah dieksekusi di harga lama.
  • 5 sinyal / 60 detik per akun; lebih dari itu webhook membalas 429.
  • Filter duplikat: sinyal identik dalam 10 detik hanya diterima sekali (409).
  • Batas posisi terbuka: MaxOpenPositions, default 20.
  • Stop loss di sisi yang salah dari harga saat ini ditolak beserta alasannya.

Keamanan

Setiap akun punya Webhook Secret (agar TradingView mengirim sinyal) dan EA Token (agar EA mengambil sinyal) sendiri. AlertConnector tidak butuh kata sandi broker: EA membuka order di dalam MetaTrader Anda.

Mengirim sinyal dari skrip sendiri, bukan TradingView? Anda bisa menghilangkan kolom secret dan menandatangani body dengan header X-Signature = HMAC-SHA256 (hex) dari body mentah, dengan kunci Webhook Secret.

Jangan pernah membagikan tangkapan layar yang menampilkan Webhook Secret atau EA Token. Saat mengirim tangkapan layar ke dukungan, tutupi kedua nilai itu.

Pemecahan masalah

Setiap sinyal di riwayat memiliki salah satu status berikut:

StatusArti
BerhasilEA sudah mengeksekusi order. Tiket broker ditampilkan.
Tidak ada yang perlu dilakukanSintaks benar tetapi tidak ada yang dieksekusi — misalnya close_all saat tidak ada posisi. Ini bukan error.
ErrorDitolak broker atau EA. Alasannya tepat di bawah label, beserta kode broker jika ada.
Tidak diambil EAEA tidak mengambil sinyal dalam 60 detik, jadi sinyal diabaikan agar tidak masuk di harga lama.
Menunggu / DiprosesSinyal baru tiba; EA belum mengambil atau sedang mengeksekusinya.

Kode respons webhook (TradingView menampilkannya di log alert):

KodePenyebab
200Sinyal diterima.
400JSON tidak valid, simbol kosong, atau aksi tidak ada di daftar.
401Webhook Secret tidak cocok, atau URL memakai Account ID yang salah.
403Lisensi habis, uji coba habis, atau akun sedang dijeda.
409Sinyal identik sudah diterima dalam 10 detik terakhir (TradingView mengirim ulang atau tombol uji diklik dua kali).
429Lebih dari 5 sinyal dalam 60 detik untuk satu akun.

EA tidak menerima sinyal? Periksa berurutan: MT5 terbuka dan sudah login; Algo Trading menyala; https://alertconnector.vercel.app ada di daftar WebRequest; Account ID dan EA Token benar; tab Experts tidak menampilkan error 401.

Masih belum berhasil? Kirim email ke hello@tradeedgelab.com dengan tangkapan layar tab Experts dan riwayat sinyal (tutupi kunci rahasia).