1. Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)
    Dismiss Notice

Answered Help Ajarin buat EA Sederhana

Discussion in 'Belajar MQL dari Nol' started by Artomoro Trader, 22 May 2016.

  1. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Ijin buat thread om momod...

    Ane mau belajar buat EA sederhana, ada yang bisa bantuin??? EA ini menggunakan indikator bawaan MT4 yaitu Moving Average..

    Rulesnya: jika harga valid break dari atas kebawah, maka sell dan jika harga valid break dari bawah keatas maka buy.
     
  2. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Bisa menggunakan MA periode berapa saja untuk contoh periode 12 seperti gambar berikut ini
     

    Attached Files:

  3. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Code:
    //+------------------------------------------------------------------+
    //|                                                          ATS.mq4 |
    //|                        Copyright 2016, MetaQuotes Software Corp. |
    //|                                        http://www.metaquotes.net |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2016, MetaQuotes Software Corp."
    #property link      "http://www.metaquotes.net"
    
    extern string  Nama_EA                 = "ATS";
    extern int     TP                      = 100;
    extern int     SL                      = 100;
    extern double  Lots                    = 0.01;
    
    //+------------------------------------------------------------------+
    //| expert initialization function                                   |
    //+------------------------------------------------------------------+
    int init()
      {
    //----
    
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    int deinit()
      {
    //----
    
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| expert start function                                            |
    //+------------------------------------------------------------------+
    int start()
      {
    //----
    double ma = iMA(Symbol(),0,12,1,0,0);
    if (Open[1]>ma&&Close[1]<ma)
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    
    
    
    Nggak tau coding, dicompile langsung error :(
     
    Last edited: 22 May 2016
  4. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Rules OP dan Close sesuai dengan EA ini, silahkan BT dan masukkan indikator bolinger 24 agar tau cara OP dan Closenya..
     

    Attached Files:

  5. NeoBatavia

    NeoBatavia Well-Known Member Credit Hunter

    Equity
    Credit
    Ref Point
    Critical error Pak ketika di BT
     
  6. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Yang mana ya gan???
     
  7. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Code:
    //+------------------------------------------------------------------+
    //|                                                          ATS.mq4 |
    //|                        Copyright 2016, MetaQuotes Software Corp. |
    //|                                        http://www.metaquotes.net |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2016, MetaQuotes Software Corp."
    #property link      "http://www.metaquotes.net"
    
    extern string  Nama_EA                 = "ATS";
    extern int     TP                      = 100;
    extern int     SL                      = 100;
    extern double  Lots                    = 0.01;
    
    //+------------------------------------------------------------------+
    //| expert initialization function                                   |
    //+------------------------------------------------------------------+
    int init()
      {
    //----
    
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    int deinit()
      {
    //----
    
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| expert start function                                            |
    //+------------------------------------------------------------------+
    int start()
      {
    //----
    if (OrdersTotal()==0)
    {
    double MA =iMA(Symbol(),0,24,0,MODE_SMA,PRICE_WEIGHTED ,1);
         if(Open[1] > MA  && Close[1]> MA) { order buy }
    OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-SL*Point, Ask+TP*Point, "ATS", 0, 0, Green);
         if(Open[1] < MA  && Close[1]< MA) {  order sell }
    {
    OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+SL*Point, Bid-TP*Point, "ATS", 0, 0, Red);
    }
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    
    
    
    Errorrrrr.................
     
  8. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Hmmm,.. yg pinter coding nggak ada yg mau bantu....
     
  9. Yasir Arafat

    Yasir Arafat Member

    Equity
    Credit
    Ref Point
    silahkan ganti codingannya pakai yang ini
    Code:
    int start(){
    if (OrdersTotal()==0){
    int ticket=0;
    double MA =iMA(Symbol(),0,24,0,MODE_SMA,PRICE_WEIGHTED ,1);
         if(Open[1] > MA  && Close[1]> MA)
            ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-SL*Point, Ask+TP*Point, "ATS", 0, 0, Green);
         if(Open[1] < MA  && Close[1]< MA)
            ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+SL*Point, Bid-TP*Point, "ATS", 0, 0, Red);}
       return(0);}
    
    penjelasan error pada kode sebelumnya :
    Code:
    int start()
      {
    //----
    if (OrdersTotal()==0)
    {
    double MA =iMA(Symbol(),0,24,0,MODE_SMA,PRICE_WEIGHTED ,1);
         if(Open[1] > MA  && Close[1]> MA) [COLOR=#ff0000][B]{ order buy }[/B][/COLOR] //jika ingin membuat comment setelah baris code maka pakai tanda "//" sebelum comment 
    OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-SL*Point, Ask+TP*Point, "ATS", 0, 0, Green);//tambahkan variable double ticket agar tidak ada warning setelah pembetulan
         if(Open[1] < MA  && Close[1]< MA) [COLOR=#ff0000][B]{  order sell }[/B][/COLOR][COLOR=#000000] //ini juga sama[/COLOR]
    {
    OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+SL*Point, Bid-TP*Point, "ATS", 0, 0, Red);//tambahkan variable double ticket agar tidak ada warning setelah pembetulan
    }
    //----
       return(0);
      }
    oke sekian penjelasannya.
    jika ada yang mau ikut belajar coding ea simple silahkan masuk ke tread ane ini https://soehoe.com/buat-ea-mudah-rame-rame-seru-by-wame.t5169/#post-106505
     
  10. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Thanks gan,... :D
    meluncur ke TKP ======>
     
  11. Yasir Arafat

    Yasir Arafat Member

    Equity
    Credit
    Ref Point
    siap gan, ditunggu kedatangannya dan share codingnya.... xixiii
     
  12. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    wkwkwkk, ane gk paham coding gan.. kalau bersedia buatin EA ane punya rulesnya nie gan :D
     
  13. blackking

    blackking Well-Known Member Credit Hunter

    Equity
    Credit
    Ref Point
     
  14. Yasir Arafat

    Yasir Arafat Member

    Equity
    Credit
    Ref Point
    jika strategi sudah terbukti profit walau hanya 10 % per bulan dengan maks DD tidak diatas 30% saya siap buatkan EAnya.
     
  15. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Nah tekniknya belum dicoba gan hehee, mau BT dibuat EA gitu rencananya..
     
  16. Yasir Arafat

    Yasir Arafat Member

    Equity
    Credit
    Ref Point
    jiah... kalau memang belum di coba silahkan dicoba dulu gan pakai trading simulator aja biar cepat dan hasilnya cukup untuk melihat profit in% dan max DD
     
  17. Artomoro Trader

    Artomoro Trader Member Credit Hunter

    Equity
    Credit
    Ref Point
    Tekniknya perlu pengaman trailing stop beserta trailing step yg agak tipis, kalau pake trading simulator gk jadi gan :D
     
  18. Yasir Arafat

    Yasir Arafat Member

    Equity
    Credit
    Ref Point
    oke deh.... heee
     

Share This Page