Belajar Membuat EA Sederhana 38 (terapan indikator IFX_Keltner_Channel III)
Dibagian sebelumnya sudah di jelaskan tentang model indikator ini. dan juga ada teman yang sudah bikin eanya di part sebelum nya .
Kali saya juga agan share tentang ea yg berdasarkan indikator ini dengan model averaging .
EA ini cococok untuk mengejar rabat !
Tapi jangan lupa Ea ini ada proteksi demonya | jadi harus dihilangkan dulu
e
gitu deh sementara
//+------------------------------------------------------------------+
//| Jum+Keltner Chan .mq4 |
//| Copyright 2013, Annura |
//| gifaesa@yahoo.com |
//| http://JumForex.blogspot.com |
//+------------------------------------------------------------------+
#property copyright "JumForex.blogspot.com"
#property link "Gifaesa@yahoo.com"
extern string Nama_EA = "Jum+Keltner+Chan";
extern int TP = 11;
extern int TP_money = 11;
extern int SL = 20;
extern bool SL_otomatis = false;
extern double Lot = 0.01;
extern int Magic = 69;
extern int Mode_Ma = 0;
extern int Ma_Pareode = 10;
extern int Price_tip = 5;
extern int Max_order = 2;
double pt,SLb,TPb,SLs,TPs;
int init()
{
if(Digits==3 || Digits==5) pt=10*Point; else pt=Point;
return(0);
}
int deinit()
{
return(0);
}
int start() {lab();
if(!IsDemo()){Alert("hanya untuk demo boss"); return(0);}
if(TP_money<=man())closeall();
double kfa = iCustom(Symbol(),0,"IFX_Keltner_Channel",Ma_Pareode,Mode_Ma,Price_tip,0,0);
double kfm = iCustom(Symbol(),0,"IFX_Keltner_Channel",Ma_Pareode,Mode_Ma,Price_tip,1,0);
double kfb = iCustom(Symbol(),0,"IFX_Keltner_Channel",Ma_Pareode,Mode_Ma,Price_tip,2,0);
static datetime w;
if(TP==0)TPb=0;else TPb=Ask+TP*pt;
if(TP==0)TPs=0;else TPs=Bid-TP*pt;
if(SL==0)SLb=0;else SLb=Ask-SL*pt;
if(SL==0)SLs=0;else SLs=Bid+SL*pt;
if(SL_otomatis){ SLb=kfb; SLs=kfa;}//else if(!SL_otomatis){SLb=Ask-SL*pt; SLs=Bid +SL*pt;}
if(w!=Time[0] && IsDemo()){
if(Ask<kfb && JumlahOrder(0)<Max_order) {
OrderSend(Symbol(),OP_BUY,Lot,Ask,3,SLb,TPb,Nama_EA,Magic,0,Blue);
}
if(Bid>kfa && JumlahOrder(1)<Max_order) {
OrderSend(Symbol(),OP_SELL,Lot,Bid,3,SLs,TPs,Nama_EA,Magic,0,Red);
}
w=Time[0]; }
return(0);
}
//+------------------------------------------------------------------+
int JumlahOrder(int Tipe){ int Total = 0;
for(int i=0; i<OrdersTotal(); i++) {
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()!=Symbol() || OrderMagicNumber()!=Magic || OrderType()!=Tipe) continue;
if(IsDemo())Total++; }
return(Total);}
double man(){double Total = 0;
for(int i=0; i<OrdersTotal(); i++) {
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()!=Symbol() || OrderMagicNumber()!=Magic ) continue;
if(IsDemo())Total+=OrderProfit(); }
return(Total);}
void closeall(){
for (int i = OrdersTotal() - 1; i >= 0; i--) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber()!=Magic ) continue;
if (OrderType() > 1) OrderDelete(OrderTicket());
if (OrderType() == 0) OrderClose(OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
if (OrderType() == 1)OrderClose(OrderTicket(), OrderLots(), Ask, 3, CLR_NONE); }}
void lab(){
Comment("\n ",
"\n ------------------------------------------------",
"\n :: Spread : ", MarketInfo(Symbol(), MODE_SPREAD),
"\n :: Leverage : 1 : ", AccountLeverage(),
"\n :: Equity : ", AccountEquity(),
"\n :: Jam Server :", Hour(), ":", Minute(),
"\n ------------------------------------------------",
"\n :: Total Op Buy : ",JumlahOrder(0),
"\n :: Total Op Sell : ",JumlahOrder(1),
"\n ------------------------------------------------",
"\n :: >>By: Jum69<<",
"\n ------------------------------------------------");
}