Coding MQL4 Buat EA Martingale

Bagi Teman-Teman Yang Mencari Script atau Coding MQL4 Buat EA Martingale Silahkan Klik dan Baca Tutorial Belajar Program MQL4 diBawah Ini!

//Coding MQL4 variable EA martingale:
extern double Lotsbuy1            = 0.1;
extern int SLbuy1                 = 0;
extern int TPbuy1                 = 100;

extern double Jarak_Buy2dariBuy1  = -25; //=-250 pips

extern double Lotsbuy2            = 0.2;
extern int SLbuy2                 = 0;
extern int TPbuy2                 = 200;

extern double Jarak_Buy3dariBuy1  = -50; //=-500 pips

extern double Lotsbuy3            = 0.4;
extern int SLbuy3                 = 0;
extern int TPbuy3                 = 400;

//Coding MQL4 fungsi OnTick EA Martingale:
void OnTick()
  {
   LabelInfoAkun(); 
   //coding untuk memanggil fungsi untuk menampilkan teks digrafik
   
   CekOpenOrderProfit();
   CekOpenOrderProfit3();

   if(OrdersTotal()==0) //logic EA buy jika jumlah order nol
     {
      BuyOrder(); //coding untuk memanggil fungsi transaksi buy
     }
  }

//+------------------------------------------------------------------+
//Coding MQL4 Fungsi Cek Open Order Profit EA Martingale:
void CekOpenOrderProfit()
  {
   double profit = 0;
   for(int i=OrdersTotal()-1; i >= 0; i--)
     {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
        {
         if(OrderType() == OP_BUY 
         && OrderSymbol() == Symbol() 
         && OrderMagicNumber() == 1)
           {
            profit += OrderProfit();
           }
        }
     }

   if(profit < Jarak_Buy2dariBuy1)
     {
      BuyOrderMartingale();

     }
  }

//+------------------------------------------------------------------+
//Coding MQL4 Fungsi Buy Order Martingale:
void BuyOrderMartingale()
  {
   bool exists = false;
   for(int i=OrdersTotal()-1; i >= 0; i--)
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
        {
         if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == 2)
           {
            exists = true;
           }
        }

   if(exists == false)
     {
      int ticket = OrderSend(Symbol(),OP_BUY,Lotsbuy2,Ask,4,0,Ask+TPbuy2*Point,"beli2",2,0,Blue);

     }
  }

//+------------------------------------------------------------------+
void CekOpenOrderProfit3()
  {
   double profit = 0;
   for(int i=OrdersTotal()-1; i >= 0; i--)
     {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
        {
         if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
           {
            profit += OrderProfit();
           }
        }
     }

   if(profit < Jarak_Buy3dariBuy1)
     {
      BuyOrderMartingale3();

     }
  }

//+------------------------------------------------------------------+
void BuyOrderMartingale3()
  {
   bool exists = false;
   for(int i=OrdersTotal()-1; i >= 0; i--)
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
        {
         if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == 3)
           {
            exists = true;
           }
        }

   if(exists == false)
     {
      int ticket = OrderSend(Symbol(),OP_BUY,Lotsbuy3,Ask,4,0,Ask+TPbuy3*Point,"beli3",3,0,Blue);

     }
  }

//+------------------------------------------------------------------+/

//void LabelInfoAkun()

  {

   Comment("\n"

           "\nBalance: ", DoubleToStr(AccountBalance(),2),

           "\nEquity: ", DoubleToStr(AccountEquity(),2),

           "\nProfit: ", DoubleToStr(AccountProfit(),2));

  }

Semoga Bermanfaat dan Kalau Ada Pertanyaan Terkait Dengan Coding MQL4 Buat EA Martingale, Tulis diKolom Komentar atau Hubungi ke Kontak Kami!

Bagikan:

0 comments:


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.

Products Overseas

Hosting Luar Negeri: BlueHost
MAU DAFTAR FOREX?
Buka Formulirnya Klik Disini!
Baca Panduannya Klik Disini!