Tempat belajar forex untuk pemula dan advanced, bisa belajar trading forex dengan cara manual ataupun automatic dengan robot forex / EA

Script / Coding MQL4 EA Robot Forex Parabolic Sar

Halo Teman-Teman Trader Semuanya Yang Lagi Belajar Membuat Expert Advisor, Selamat Datang di Tutorial Belajar Coding EA, Kali Ini Solo.KursusForex.net Akan Berbagi "Script atau Coding MQL4 EA Robot Forex Parabolic Sar", Ini Gambar Screenshotnya, Lihat diBawah!

Sintaq Script Coding MQL4 EA Robot Forex Parabolic Sar:

///+------------------------------------------------------------------+
//|                                             EA PARABOLIC SAR.mq4 |
//|                                                       DAFTAR MT4 |
//|                                           http://daftarmt4.my.id |
//+------------------------------------------------------------------+
#property copyright "DAFTAR MT4"
#property link      "http://daftarmt4.my.id"
#property version   "1.00"
#property strict
//tambahkan coding variable disini
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  { 
   InfoAkun();
   int shiftsar         = 1;
   double close         =iClose(Symbol(),0,shiftsar);
   double ParabolicSar  = iSAR(Symbol(),PERIOD_D1,0.02,0.2,shiftsar);


   double SignalBuy_PR  = ParabolicSar < close && ParabolicSar > 0;
   double SignalSell_PR = ParabolicSar > close && ParabolicSar > 0;
   
   if(OrdersTotal()==0)
     {
     if(SignalBuy_PR  == true) buyorder();
     if(SignalSell_PR == true) sellorder();
     }
  }  
//+------------------------------------------------------------------+
void buyorder()
  {
   int ticket = OrderSend(Symbol(),OP_BUY,0.1,Ask,4,Ask-200*Point,Ask+1000*Point);
  }
//+------------------------------------------------------------------+
void sellorder()
  {
   int ticket = OrderSend(Symbol(),OP_SELL,0.1,Bid,4,Bid+200*Point,Bid-1000*Point);
  }
//+------------------------------------------------------------------+
void InfoAkun()
  {
   Comment("\nBALANCE: ", DoubleToStr(AccountBalance(),2),
           "\nEQUITY: ", DoubleToStr(AccountEquity(),2),
           "\n\nPROFIT: ", DoubleToStr(AccountProfit(),2));
  }
//+------------------------------------------------------------------+/

Teman-Teman Trader Semuanya Yang Lagi Belajar Membuat Expert Advisor, Itulah "Script atau Coding MQL4 EA Robot Forex Parabolic Sar", Yang Dapat Kami bagikan Kepada Anda, Semoga Bermanfaat.

Coding MQl4 Fungsi Cek Profit & Close All

Belajar Program MQL4 Cara Menulis Coding MQl4 Fungsi Cek Profit & Close All.

Keterangan Script MQL4 Fungsi Cek Profit (Laba):

double CekProfit()

  {
   double totalprofit = 0;
   for(int i=OrdersTotal()-1; i>=0; i--)
     {
      if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
         continue;
      //if(OrderSymbol()!=Symbol()) continue;
      //if(OrderType()!=type) continue;
      totalprofit+=OrderProfit();
     }
   return(totalprofit);
  }

Keterangan Script MQL4 Fungsi Close All:

void CloseAll()
  {
   for(int i=OrdersTotal()-1; i>=0; i--)
     {
      if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
         continue;
      int oticket = OrderTicket();
      if(OrderClose(oticket,OrderLots(),OrderClosePrice(),4))
        {
         Print("Order Close Berhasil, Ticket: ",(string)oticket);
        }
     }
  }

Ada Pertanyaan Seputar Belajar Program MQL4 Cara Mengetikkan Coding MQl4 Fungsi Cek Profit & Close All? Silahkan Hubungi ke Kontak Kami atau tinggalkan kalimat pertanyaan Anda dikolom Komentar!



Tutorialnya, klik disini!

HP Android Untuk Trading

Spesifikasi HP Android Yang Baik
Untuk Trading Forex :


  • RAM minimal 2 GB
  • Display LCDnya minimal 5 inc
  • Sudah Support jaringan 4G

CARA DAFTAR INSTAFOREX