Pelatihan Belajar Membuat EA Expert Advisor. Hari 1 Kursus Murid Langsung diPandu Untuk Praktek Menuliskan Coding/Script Robot Forexnya Dengan Menggunakan Bahasa Pemrograman MQL4 (MetaQuotes Language Editor).
PELATIHAN EA ROBOT FOREX: buka hari Senen s.d Jumat, Weekend Sabtu Minggu Jam Jadwal Belajarnya Sesuai Kesepakatan. Perlengkapan Bawa Laptop HP Android dan Koneksi Internet. Setiap Pertemuan Waktu Kursusnya 1-2 jam. Menerima kursus privat 1-2 hari fullday mulai jam 09.00-21.00 wib.
LANGKAH MENJALANKAN MQL4 UNTUK MEMBUAT EA FOREX:
Buka MT4/Metatrader4 - Terbuka Halaman MetaEditor Klik Tombol New - Keluar Kotak Pop Up MQL4 Wizard Biarkan Yang Tercentang Lingkaran Expert Advisor terus klik tombol Next - Kolom Name isi dengan Nama EA yang Akan dibuat misalkan EA Averaging - Kolom Author dan Kolom Link boleh dikosongkan terus klik Next - Kotak Checklist OnTimer dan OnChartEvent Tidak perlu diCentang terus klik tombol Next - Kotak CheckList OnTester tidak perlu dicentang terus klik tombol Finish!
_____
CONTOH SCRIPT MQL4 UNTUK MEMBUAT VARIABLE EA:
Keterangan:
#property copyright "Solo Online"
#property link "solo-on-line.com/2021/09/pelatihan-belajar-membuat-ea-expert.html"
extern double Lots = 0.2;
extern bool BuyStatus = true;
extern bool SellStatus = true;
extern int Mulai_Jam = 0;
extern int Akhir_Jam = 24;
extern bool LabaTp_inMoneyStatus = TRUE;
extern bool RugiTp_inMoneyStatus = FALSE;
extern double LabaTP_inmoney = 50;
extern double RugiTP_inmoney = -10;
extern int LevelAverage = 50;
extern int TP = 0;
extern int SL = 0;
extern bool TrailingStatus = FALSE;
extern int TrailingStop = 10;
extern int Magic = 2222;
string beli = "EA sukses buy";
string jual = "EA sukses sell";
int ticket1,ticket2,ticket3;
double slb,tpb,sls,tps,pipp;
int tiket;
datetime checktime = 0;
#fungsi init
int init()
{
if(Digits==3 || Digits==5) pipp=10*Point; else pipp=Point;
return(0);
}
//fungsi deinit
int deinit()
{
ObjectsDeleteAll();
return(0);
}
#fungsi Ontick
void OnTick()
{
TeksInfoAkun();
if(TrailingStatus)
trailingstopp();
if(LabaTp_inMoneyStatus && LabaTP_inmoney<= laba())
closeall(); //logic hidden tp
if(RugiTp_inMoneyStatus && RugiTP_inmoney>= laba())
closeall(); //logic hidden sl
double MA2 = MA();
double Zig12 = ZigZag();
if(Jam_trading()==true)
{
//variable supaya sl dan tp ea dapat diisi angka 0
if(SL==0) slb=0; else slb=Ask-SL*pipp;
if(SL==0) sls=0; else sls=Bid+SL*pipp;
if(TP==0) tpb=0; else tpb=Ask+TP*pipp;
if(TP==0) tps=0; else tps=Bid-TP*pipp;
//start logic op setiap signal yang bikin average
datetime itime = iTime(Symbol(),0,0);
if(checktime!=itime)
{
if(jumlahorder(0)<LevelAverage && jumlahorder(1)==0 && BuyStatus && Zig12==1)
{ticket1=OrderSend(Symbol(),OP_BUY,NL(Lots),Ask,3,slb, tpb,beli,Magic,0,Blue);}
if(jumlahorder(0)==0 && jumlahorder(1)<LevelAverage && SellStatus && Zig12==2)
{ticket1=OrderSend(Symbol(),OP_SELL,NL(Lots),Bid,3,sls, tps,jual,Magic,0,Red);}
checktime=itime;
} //finish logic op setiap signal yang bikin average
}
return;
}
#fungsi jam mulai dan berhenti trading
int Jam_trading()
{
bool trade = false;
if(Mulai_Jam > Akhir_Jam)
{
if(Hour() >= Mulai_Jam || Hour() < Akhir_Jam)
trade = true;
}
else
if(Hour() >= Mulai_Jam && Hour() < Akhir_Jam)
trade = true;
return (trade);
}
//+------------------------------------------------------------------+
#fungsi check jumlah op buy dan sell
int jumlahorder(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);
}
#fungsi untuk menormalkan lots
double NL(double lotsnya)
{
double maxlots = MarketInfo(Symbol(), MODE_MAXLOT),
minilot = MarketInfo(Symbol(), MODE_MINLOT),
lstep = MarketInfo(Symbol(), MODE_LOTSTEP);
double lots = lstep * NormalizeDouble(lotsnya / lstep, 0);
lots = MathMax(MathMin(maxlots, lots), minilot);
return (lots);
}
#fungsi trailing stop
void trailingstopp()
{
for(int i=0; i<OrdersTotal(); i++)
{
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
continue;
if(OrderSymbol()!=Symbol() || OrderMagicNumber()!=Magic)
continue;
if(OrderType()==OP_BUY)
{
if(Bid-OrderOpenPrice()>pipp*TrailingStop)
{
if((OrderStopLoss()<Bid-pipp*TrailingStop) || (OrderStopLoss()==0))
{
ticket2=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-pipp*TrailingStop,
OrderTakeProfit(),0,Green);
}
}
}
if(OrderType()==OP_SELL)
{
if((OrderOpenPrice()-Ask)>(pipp*TrailingStop))
{
if(OrderStopLoss()>(Ask+pipp*TrailingStop) || (OrderStopLoss()==0))
{
ticket2=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+pipp*TrailingStop,
OrderTakeProfit(),0,Red);
}
}
}
}
}
#fungsi close semua transaksi
void closeall()
{
for(int i = OrdersTotal() - 1; i >= 0; i--)
{
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
continue;
if(OrderSymbol() != Symbol() || OrderMagicNumber()!=Magic)
continue;
if(OrderType() > 1)
ticket3=OrderDelete(OrderTicket());
else
{
if(OrderType() == 0)
ticket3=OrderClose(OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
else
ticket3=OrderClose(OrderTicket(), OrderLots(), Ask, 3, CLR_NONE);
}
}
}
#fungsi check laba
double laba()
{
double labatotal = 0;
int i;
for(i = 0; i < OrdersTotal(); i++)
{
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
continue;
if(OrderSymbol() != Symbol() || OrderMagicNumber()!=Magic)
continue;
labatotal += OrderProfit();
}
return(labatotal);
}
#fungsi indikator MA14 di atas atau dibawah Ask atau Bid
int MA()
{
double MA14 =iMA(Symbol(),0,14,0,MODE_SMA,PRICE_CLOSE,0);
int signalMA22 = 0;
if(Ask>MA14)
signalMA22=1;// signal buy
if(Bid<MA14)
signalMA22=2;// signal sell
return(signalMA22);
}
#fungsi signal zigzag
int ZigZag()
{
int SHIFT_ZIGZAG = 1;
double CLOSE =iClose(Symbol(),0,SHIFT_ZIGZAG);
double ZIGZAG = iCustom(Symbol(),0,"ZigZag",12,5,3,0,SHIFT_ZIGZAG);
int signalzigZAG2 =0;
if(ZIGZAG<CLOSE && ZIGZAG>0)
signalzigZAG2=1; //signal buy
if(ZIGZAG>CLOSE && ZIGZAG>0)
signalzigZAG2=2; //signal sell
return(signalzigZAG2);
}
#fungsi untuk menampilkan teks pada chart
void TeksInfoAkun()
{
string AkunNomor = "AKUN : "+DoubleToStr(AccountNumber(),0);
ObjectCreate("labelNomor", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelNomor", AkunNomor, 12, "Arial Bold", Yellow);
ObjectSet("labelNomor", OBJPROP_CORNER, 0);
ObjectSet("labelNomor", OBJPROP_XDISTANCE, 10);
ObjectSet("labelNomor", OBJPROP_YDISTANCE, 10);
string AkunBalance = "BALANCE : "+DoubleToStr(AccountBalance(),2);
ObjectCreate("labelBalance", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelBalance", AkunBalance, 12, "Arial Bold", Pink);
ObjectSet("labelBalance", OBJPROP_CORNER, 0);
ObjectSet("labelBalance", OBJPROP_XDISTANCE, 10);
ObjectSet("labelBalance", OBJPROP_YDISTANCE, 30);
string AkunEquity = "EQUITY : "+DoubleToStr(AccountEquity(),2);
ObjectCreate("labelEquity", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelEquity", AkunEquity, 12, "Arial Bold", Blue);
ObjectSet("labelEquity", OBJPROP_CORNER, 0);
ObjectSet("labelEquity", OBJPROP_XDISTANCE, 10);
ObjectSet("labelEquity", OBJPROP_YDISTANCE, 50);
string JumlahTransaksi = "JUMLAH ORDER : "+DoubleToStr(OrdersTotal(),0);
ObjectCreate("labeljumlahtransaksi", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labeljumlahtransaksi", JumlahTransaksi, 12, "Arial Bold", Magenta);
ObjectSet("labeljumlahtransaksi", OBJPROP_CORNER, 0);
ObjectSet("labeljumlahtransaksi", OBJPROP_XDISTANCE, 10);
ObjectSet("labeljumlahtransaksi", OBJPROP_YDISTANCE, 70);
string AkunProfit = "PROFIT : $ "+DoubleToStr(AccountProfit(),2);
ObjectCreate("labelProfit", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelProfit", AkunProfit, 12, "Arial Bold", Aqua);
ObjectSet("labelProfit", OBJPROP_CORNER, 0);
ObjectSet("labelProfit", OBJPROP_XDISTANCE, 10);
ObjectSet("labelProfit", OBJPROP_YDISTANCE, 90);
}
//+------------------------------------------------------------------+
Fungsi init dan deinit:
Fungsi Ontick:
Fungsi mql4 ea jam mulai dan berhenti trading:
Fungsi mql4 ea jumlah order:
Fungsi mql4 ea untuk menormalkan lots:
Fungsi mql4 ea trailing stop:
Fungsi mql4 ea close all order:
Fungsi mql4 jumlah total profit:
Fungsi mql4 ea moving average dan zigzag:
Fungsi mql4 untuk menampilkan teks di chart:
Demikian Informasi Pelatihan Belajar Membuat EA Expert Advisor Robot Forex Yang Dapat Kami Sampaikan Kepada Anda, Bagi Bapak Ibu Yang Berminat Untuk Daftar Silahkan Anda Menghubungi Mentornya ke WA 087835278694!
0 comments:
Posting Komentar