Kursus Forex Solo Tempat Belajar Trading Forex Solo Pelatihan Forex Solo Edukasi Forex Solo Training Forex Solo Privat Membuat EA Robot Forex

BACA TUTORIAL: CARA DAFTAR MT4 FOREX!

Cara Create Script Robot Forex Martingale

Cara Create Script Robot Forex Martingale. Belajar Menulis / Mengetik Coding MQL4 Untuk Membuat EA Martingale. Kalau Ingin Praktek Mengcreate EA Martingalenya, Tetapi Anda Belum Punya Softwarenya, Silahkan Terlebih Dulu Anda Menginstall Software MT4 / Metatrader4 ke Komputer Anda. Pastikan Yang Anda Install Adalah Software MT4 Bukan MT5 / Metatrader5.


Coding MQL4 Fungsi Pengali Lots EA Martingale.

Untuk Saat Ini Membuat Robot Forex (Martingale) Itu Belum Bisa diLakukan Memakai HP Android, Bisanya Masih Harus Menggunakan Laptop Yang Sudah Ada Software Metatrader 4 nya. Adapun Langkah - Langkah Untuk Robot Forex Martingale Itu Adalah Sbb:
Buka Metatrader4nya.
Klik Menu MetaQuotes Language Editor.
Klik Menu New.(Create A New Document).
Klik Lingkaran Expert Advisor (Template).
Klik Tombol Next.
Kolom Name Ketik Seperti Ini Experts\EA Martingale.
Kolom Auhor & Link Boleh diKosongkan.
Klik Next.
Klik Next.
Klik Finish.
Terbuka Halaman MetaEditor.
Hapus Semua Codingnya.
Ketikkan Script EA Martingale Seperti Contoh di Bawah.
Klik Menu Compile.
Anda Sudah Selesai Create EA Martingale.

////+------------------------------------------------------------------+
//|                                                EA_MARTINGALE.mq4 |
//|                                                       Daftar MT4 |
//|                                           http://daftarmt4.my.id |
//+------------------------------------------------------------------+
#property copyright "Daftar MT4"
#property link      "http://daftarmt4.my.id"
#property version   "1.00"

input double Lots                  = 0.1;
input int    TP                    = 10;
input int    SL                    = 0;
input string Setting_Martingale    = "";
input int    Jarak_Order           = 10;
input double Kali_Lots             = 3;
input int    Maks_Order            = 30;
 int    Magic                      = 777;
 string CommentEABuy               = "EAbuy";
 string CommentEASell              = "EAsell";

double pt,SLb,TPb,SLs,TPs;
int ticket,tiket;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   if(Digits==3 || Digits==5) pt=10*Point; else pt=Point;
   //coding ea support harga mata uang forex 4/5 angka dibelakang koma
   return(INIT_SUCCEEDED);
  }
  
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  ObjectsDeleteAll();
  }  
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnTick()
  {
   modifytp();
   label();
   double jumlahbuy  = JumlahOrder(0);
   double jumlahsell = JumlahOrder(1);
   
   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;
   
   double sma7  = iMA(Symbol(),NULL,7,0,MODE_SMA,PRICE_CLOSE,0);
   double sma14 = iMA(Symbol(),NULL,14,0,MODE_SMA,PRICE_CLOSE,0);
   
   if(jumlahbuy+jumlahsell==0)
     {
      if(sma7>sma14) //logic signal buy
        {
         ticket=OrderSend(Symbol(),OP_BUY,(Lots),Ask,3,SLb,TPb,CommentEABuy,Magic,0,Blue);
        }
      if(sma7<sma14) //logic signal sell
        {
         ticket=OrderSend(Symbol(),OP_SELL,(Lots),Bid,3,SLs,TPs,CommentEASell,Magic,0,Red);
        }
     }
   if(jarakop()==1 && JumlahOrder(0)>=1 && JumlahOrder(0)< Maks_Order)
     {
      ticket=OrderSend(Symbol(),OP_BUY,kalilot(0),Ask,3,SLb, TPb,CommentEABuy,Magic,0,Blue);
     }
   if(jarakop()==2 && JumlahOrder(1)>=1 && JumlahOrder(1)< Maks_Order)
     {
      ticket=OrderSend(Symbol(),OP_SELL,kalilot(1),Bid,3,SLs,TPs,CommentEASell,Magic,0,Red);
     }

  }
//+------------------------------------------------------------------+
void modifytp() //fungsi modifikasi tp
  {
   int i,mtp;
   double tpnya,dtp;
   for(i = 0; i < OrdersTotal(); i++)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
         continue;
      if(OrderSymbol() != Symbol())
         continue;
      tpnya=OrderTakeProfit();
     }
   for(i = OrdersTotal() - 1; i >= 0; i--)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
         continue;
      if(OrderSymbol() != Symbol())
         continue;
      dtp=OrderTakeProfit();
      if(tpnya!=dtp)
         mtp=OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), tpnya, 0, CLR_NONE);
     }
  }
//+------------------------------------------------------------------+

int jarakop() //fungsi jarak order
  {
   int type,dp;
   double opb,ops;
   for(int i = 0; i < OrdersTotal(); i++)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
         continue;
      if(OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
         continue;
      type=OrderType();
      if(type==0)
         opb = OrderOpenPrice();
      if(type==1)
         ops = OrderOpenPrice();
     }
   double as = opb - Jarak_Order * pt;
   double bi = ops + Jarak_Order * pt;
   if(Ask <= as &&  JumlahOrder(0)> 0)
      dp=1;
   if(Bid >= bi &&  JumlahOrder(1)> 0)
      dp=2;
   return(dp);
  }
  
//+------------------------------------------------------------------+
double kalilot(int m) //fungsi pengali lot
  {
   double ylot,dlot;
   for(int i = 0; i < OrdersTotal(); i++)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
         continue;
      if(OrderSymbol() != Symbol() || OrderMagicNumber() != Magic ||OrderType()!=m)
         continue;
      dlot=OrderLots();
     }
   if(OrderType()==m)
      ylot=(Lots*MathPow(Kali_Lots,JumlahOrder(m)));
   return(ylot);
  }

//+------------------------------------------------------------------+
int JumlahOrder(int Tipe) //fungsi cek jumlah op
  {
   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);
  }

//+------------------------------------------------------------------+
double laba() //fungsi cek profit
  {
   double Total = 0;
   for(int i=0; i<OrdersTotal(); i++)
     {
      if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
         continue;
      if(OrderSymbol()!=Symbol() || OrderMagicNumber()!=Magic)
         continue;
         Total+=OrderProfit();
     }
   return(Total);
  }

//+------------------------------------------------------------------+
void closeall() //fungsi close 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());
      if(OrderType() == 0)
         tiket= OrderClose(OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
      if(OrderType() == 1)
         tiket=OrderClose(OrderTicket(), OrderLots(), Ask, 3, CLR_NONE);
     }
  }

//+------------------------------------------------------------------+
void label()
  {
   ObjectCreate("a",OBJ_LABEL,0,0,0);
   ObjectSet("a",OBJPROP_CORNER,4);
   ObjectSet("a",OBJPROP_XDISTANCE,10);
   ObjectSet("a",OBJPROP_YDISTANCE,10);
   ObjectSetText("a","Salam Profit Guys",25,"Arial",Lime);
   ObjectCreate("b",OBJ_LABEL,0,0,0);
   ObjectSet("b",OBJPROP_CORNER,3);
   ObjectSet("b",OBJPROP_XDISTANCE,10);
   ObjectSet("b",OBJPROP_YDISTANCE,10);
   ObjectSetText("b","EA MARTINGALE",16,"Arial",Lime);
   Comment("\n ",
           "\n ------------------------------------------------",
           "\n :: Spread                 : ", MarketInfo(Symbol(), MODE_SPREAD),
           "\n :: Leverage          1 : ", AccountLeverage(),
           "\n :: Balance                : ", DoubleToStr(AccountBalance(),2),
           "\n :: Equity                 : ", DoubleToStr(AccountEquity(),2),
           "\n :: Jam MT4              : ", Hour(), ":", Minute(),
           "\n ------------------------------------------------",
           "\n :: Profit                   : ",laba(),
           "\n :: Jumlah Buy          : ",JumlahOrder(0),
           "\n :: Jumlah Sell           : ",JumlahOrder(1),
           "\n ------------------------------------------------",
           "\n :: >>Hub: 087835278694<<",
           "\n ------------------------------------------------");
  }
//+------------------------------------------------------------------+

Demikian Tutorial Caranya Membuat EA Robot Forex Martingale Yang Dapat Kami Sampaikan kepada Anda, Semoga Bermanfaat. Anda Butuh Bimbingan Belajar Membuat EA Forex Dengan Bahasa Pemrograman MQL4, Silahkan Anda Hubungi Hp/Wa 087835278694 (Mentor Pelatihan EA).

0 comments: