Belajar script mql4 robot forex coding mql4 untuk membuat EA atau expert advisor.
Deskripsinya:
Coding variable EA:
extern string Nama_EA = "RANCANGAN EA SCALPING";
extern int TPbuy = 150;
extern int TPsell = 150;
extern int SLbuy = 0;
extern int SLsell = 0;
extern double Lotsbuy = 0.01;
extern double Lotssell = 0.01;
extern int Magic = 777;
Deskripsi sintaq mql4:
Coding mql4 sintaq ordersend buy dan ordersend sell:
void OnTick()
{
if(SLbuy==0)sl_buy=0; else sl_buy=Ask-SLbuy*Point;
if(TPbuy==0)tp_buy=0; else tp_buy=Ask+TPbuy*Point;
if(SLsell==0)sl_sell=0; else sl_sell=Bid+SLsell*Point;
if(TPsell==0)tp_sell=0; else tp_sell=Bid-TPsell*Point;
if(jumlahtransaksi(0)==0)
{
if(OrderSend(Symbol(),OP_BUY,Lotsbuy,Ask,3,
sl_buy, tp_buy,"eabuy",Magic,0,Blue))
Print("EAbuy sukses");
}
if(jumlahtransaksi(1)==0)
{
if(OrderSend(Symbol(),OP_SELL,Lotssell,Bid,3,
sl_sell, tp_sell,"easell",Magic,0,Red))
Print("EAjual sukses");
}
}
Deskripsi:
Script mql4 fungsi jumlah transaksi:
int jumlahtransaksi(int tipe)
{
int total=0;
for(int i=0; i<OrdersTotal(); i++)
{
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
continue;
if(OrderSymbol()!=Symbol()
|| OrderMagicNumber()!=Magic
|| OrderType()!=tipe)
continue;
total++;
}
return(total) ;
}
Pelajari Lagi:
Demikian share mengenai Coding MQL4 Untuk Membuat EA, kalau ada pertanyaan tulis dikolom komentar kalau Anda perlu bantuan bimbingan untuk belajar membuat robot forex, silahkan hubungi ke kontak kami! semoga bermanfaat.
0 comments:
Posting Komentar