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!

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.

0 comments: