Semoga Script EA Robot Forex Averaging Ini Dapat Beramnfaat Untuk Anda, Kalau Ada Pertanyaan, Silahkan Hubungi ke Kontak Kami!
PELAJARI: CARA DAFTAR MT4 FOREX!
Script EA Robot Forex Averaging
//+------------------------------------------------------------------+
//| EA AVERAGE 1OKT2021 V2.mq4 |
//| Ea Creator |
//| http://solo-on-line.blogspot.com |
//+------------------------------------------------------------------+
#property copyright "EA Creator"
#property link "HTTP://SOLO-ON-LINE.BLOGSPOT.COM"
extern string OPSI_TRADING = "";
extern bool OP_buy = true;
extern bool OP_sell = true;
extern double Lots = 0.05;
extern int TP = 0;
extern int SL = 0;
extern int Maks_order = 9;
extern string JAM_TRADING = "";
extern int Mulai_Jam = 0;
extern int Akhir_Jam = 24;
extern string SETTING_PROFITinMONEY= "";
extern bool StatusTP_inMoney = true;
extern double TP_inMoney = 20;
extern string SETTING_TRAILINGSTOP = "";
extern bool StatusTrailingStop = true;
extern int TrailingStop = 15;
extern string SETTING_MAPERIODS = "";
extern int Pereode_1 = 14;
extern int Pereode_2 = 89;
int Magic = 777;
double slb,tpb,sls,tps,pt; //pt=pipp
//slb=stoplossbuy,tpb=takeprofitbuy,sls=stoplosssell,tps=takeprofitsell
int wt,tiket; // wt=waktu, tiket=idorder
int current = 0;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//coding agar ea support pd harga mata uang 3/5 digits dibelakang koma
if(Digits==3 || Digits==5) pt=10*Point; else pt=Point; return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectsDeleteAll(); //coding u/ menghapus objek dichart jika ea diremove
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
TeksInfoAkun();
double sigup = stochasticup();
double sigdown = stochasticdown();
if(StatusTrailingStop)
trailingstopp();
if(StatusTP_inMoney && TP_inMoney<= Profits())
closeall();
//start script mql4 sintaq indikator moving average
double MA1a =iMA(Symbol(),0,Pereode_1,0,MODE_SMA,PRICE_OPEN,1);
double MA1b =iMA(Symbol(),0,Pereode_1,0,MODE_SMA,PRICE_CLOSE,1);
double MA2a =iMA(Symbol(),0,Pereode_2,0,MODE_SMA,PRICE_OPEN,2);
double MA2b =iMA(Symbol(),0,Pereode_2,0,MODE_SMA,PRICE_CLOSE,2);
//end script mql4 sintaq indikator moving average
int signal;
if(MA1a < MA1b && MA2a > MA2b)
signal=1;// signal MA buy
if(MA1a > MA1b && MA2a < MA2b)
signal=2;//signal MA sell
if(Jam_trading()==1) //0=false, 1=true
{
if(SL==0)slb=0; else slb=Ask-SL*pt;
if(SL==0)sls=0; else sls=Bid+SL*pt;
if(TP==0)tpb=0; else tpb=Ask+TP*pt;
if(TP==0)tps=0; else tps=Bid-TP*pt;
if(wt!=Time[0])
{
if(jumlahorder(0)0)
wt=Time[0];
}
}
return(0);
}
//+------------------------------------------------------------------+
int Jam_trading() //mengatur 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);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int jumlahorder(int tipe) //menghitung jumlah transaksi berdasar type
{
int result=0;
for(int i=0; ipt*TrailingStop)
{
if((OrderStopLoss()(pt*TrailingStop))
{
if(OrderStopLoss()>(Ask+pt*TrailingStop) || (OrderStopLoss()==0))
{
tiket=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+pt*TrailingStop,OrderTakeProfit(),0,Aqua);
}
}
}
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void closeall() //menutup semua transaksi
{
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)
tiket=OrderDelete(OrderTicket());
else
{
if(OrderType() == 0)
tiket=OrderClose(OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
else
tiket=OrderClose(OrderTicket(), OrderLots(), Ask, 3, CLR_NONE);
}
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double Profits() //menghitung profits / loss
{
double result = 0;
int i;
for(i = 0; i < OrdersTotal(); i++)
{
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
continue;
if(OrderSymbol() != Symbol() || OrderMagicNumber()!=Magic)
continue;
result += OrderProfit();
}
return(result);
}
int stochasticup()
{
current = current + 1;
double first = iStochastic(NULL, NULL,5,3,3,MODE_EMA,0,MODE_MAIN,current);
double second = iStochastic(NULL, NULL,18,5,3,MODE_SMA,0,MODE_SIGNAL,current);
current = current - 1;
double first0 = iStochastic(NULL, NULL,5,3,3,MODE_EMA,0,MODE_MAIN,current);
double second0 = iStochastic(NULL, NULL,18,5,3,MODE_SMA,0,MODE_SIGNAL,current);
double level20 = 30;
int result = 0;
if ((first < second && first0 > second0) && (second0 < level20))
result = 1;
return(result);
}
int stochasticdown()
{
current = current + 1;
double first = iStochastic(NULL, NULL,5,3,3,MODE_EMA,0,MODE_MAIN,current);
double second = iStochastic(NULL, NULL,18,5,3,MODE_SMA,0,MODE_SIGNAL,current);
current = current - 1;
double first0 = iStochastic(NULL, NULL,5,3,3,MODE_EMA,0,MODE_MAIN,current);
double second0 = iStochastic(NULL, NULL,18,5,3,MODE_SMA,0,MODE_SIGNAL,current);
double level80 = 70;
int result = 0;
if ((first > second && first0 < second0) && (second0 > level80))
result = 2;
return(result);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void TeksInfoAkun()
{
string AkunNomor = "AKUN : "+DoubleToStr(AccountNumber(),0);
ObjectCreate("labelNomor", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelNomor", AkunNomor, 12, "Arial Bold", Orange);
ObjectSet("labelNomor", OBJPROP_CORNER, 0);
ObjectSet("labelNomor", OBJPROP_XDISTANCE, 10);
ObjectSet("labelNomor", OBJPROP_YDISTANCE, 20);
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, 40);
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, 60);
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, 80);
double jumlahbuy = jumlah_buy();
string JumlahBeli = "JUMLAHBUY : "+jumlahbuy;
ObjectCreate("labelJumlahBeli", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelJumlahBeli", JumlahBeli, 12, "Arial Bold", Lime);
ObjectSet("labelJumlahBeli", OBJPROP_CORNER, 0);
ObjectSet("labelJumlahBeli", OBJPROP_XDISTANCE, 10);
ObjectSet("labelJumlahBeli", OBJPROP_YDISTANCE, 100);
double jumlahsell = jumlah_sell();
string JumlahJual = "JUMLAHSELL : "+jumlahsell;
ObjectCreate("labelJumlahJual", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelJumlahJual", JumlahJual, 12, "Arial Bold", Yellow);
ObjectSet("labelJumlahJual", OBJPROP_CORNER, 0);
ObjectSet("labelJumlahJual", OBJPROP_XDISTANCE, 10);
ObjectSet("labelJumlahJual", OBJPROP_YDISTANCE, 120);
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, 140);
double Sebaran = MarketInfo(Symbol(),MODE_SPREAD);
string JumlahSpread = "SPREAD : "+Sebaran;
ObjectCreate("labelJumlahSpread", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelJumlahSpread", JumlahSpread, 12, "Arial Bold", Yellow);
ObjectSet("labelJumlahSpread", OBJPROP_CORNER, 0);
ObjectSet("labelJumlahSpread", OBJPROP_XDISTANCE, 10);
ObjectSet("labelJumlahSpread", OBJPROP_YDISTANCE, 160);
double PriceBid = MarketInfo(Symbol(),MODE_BID);
string HargaBid = "PRICE : "+PriceBid;
ObjectCreate("labelHargaBid", OBJ_LABEL, 0, 0, 0);
ObjectSetText("labelHargaBid", HargaBid, 12, "Arial Bold", Lime);
ObjectSet("labelHargaBid", OBJPROP_CORNER, 0);
ObjectSet("labelHargaBid", OBJPROP_XDISTANCE, 10);
ObjectSet("labelHargaBid", OBJPROP_YDISTANCE, 180);
}
int jumlah_buy(){
int jb = 0;int i;
for (i = 0; i < OrdersTotal(); i++) {
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))continue;
if (OrderSymbol() != Symbol() || OrderMagicNumber() != Magic ) continue; //|| OrderComment() != comment
if (OrderType() == OP_BUY)
jb++;}
return(jb);}
int jumlah_sell(){
int js = 0;int i;
for (i = 0; i < OrdersTotal(); i++) {
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))continue;
if (OrderSymbol() != Symbol() || OrderMagicNumber() != Magic ) continue; //|| OrderComment() != comment
if (OrderType() == OP_SELL)
js ++;}
return(js);}
Baca Juga: Tutorial Cara Daftar Akun Mt4
CIMB Niaga, 7603 6767 7300, Arsis W | axxxxske-stsuxxxxxxxxx*#*$
OCBC NISP, 634130601924, C G Widi | suxxkamb_mnG0#M4sF40zY(35 kab & kota di JaTeng
BRI, 6440-01-001908-53-8, St S | 94jy0CWep1
Hosting PompaSubmersible.com (IdWeb) Masih Tersedia Fasilitas 4 AddOn Domain
Submersible-submersi-Solo-mnG0#M4sF40zY(
Webinar Reksadana BNI:
Zoom Webinar Reksadana BNI Securitas
Oleh Karunia Lestari, Senior Institutional Marketing STAR Asset Management (STAR1402STAR1402)
Senen 14 Februari 2022 Jam 14.00.
Link Join Zoom Klik Disini!
Yatno Bekasi.
Zoom Webinar Reksadana BNI Securitas
Oleh Karunia Lestari, Senior Institutional Marketing STAR Asset Management (STAR1402STAR1402)
Senen 14 Februari 2022 Jam 14.00.
Link Join Zoom Klik Disini!
Yatno Bekasi.
0 comments:
Posting Komentar