web statistics

Bagian 8 - Menyusun EA

Discussion in 'Tutorial MQL4' started by white_tiger, Oct 20, 2008.

  1. white_tiger

    white_tiger
    Expand Collapse
    Administrator
    Staff Member

    Joined:
    Jun 13, 2007
    Messages:
    1,501
    Likes Received:
    4
    :-?

    kalau mau open 6 order ya tinggal di for 0-5 (jadi 6x loop)
    atau di cek dulu pakai OrdersTotal()

    selisih maksudnya selisih harga open ? berarti ordernya stop/limit order?
     
  2. white_tiger

    white_tiger
    Expand Collapse
    Administrator
    Staff Member

    Joined:
    Jun 13, 2007
    Messages:
    1,501
    Likes Received:
    4
    mungkin bisa disimpan jam terakhir trade di globalvariable nya :-?

    ntar deh di tutorial selanjutnya coba bahas globalvariable :-?
     
  3. white_tiger

    white_tiger
    Expand Collapse
    Administrator
    Staff Member

    Joined:
    Jun 13, 2007
    Messages:
    1,501
    Likes Received:
    4
    klo cek open order tinggal di if OrdersTotal() aja
    klo jumlahnya tidak 0 berarti kan ada order :-?
    kalau mau di cek pair dan magic number ya ditambahi if OrderSymbol()==Symbol() dan if OrderMagicNumber()==varMagicNumber
     
  4. abiyanto

    abiyanto
    Expand Collapse
    New Member

    Joined:
    Sep 23, 2008
    Messages:
    45
    Likes Received:
    0
    Semoga bermanfaat...

    Nggak perlu global variabel.
    Cukup pasang

    Code:
      
      //---- go trading only for first tiks of new bar
      if(Volume[0]>1) return;
    
    di bawah
    Code:
      
    int start()
      {
    //----
    

    Contoh traling stop :

    Code:
    
                //Trailing stop
                if(TrailingStopMode && TrailingStop > 0) {                 
                   if(Bid - OrderOpenPrice() > Point * TrailingStop) {
                      if(OrderStopLoss() < Bid - Point * TrailingStop) {
                         OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
                      }
                   }
                }
    
    

    Pakai fungsi NumberTrades() yang akan menghasilkan nilai jumlah order yang saat ini open.

    Code:
    int NumberTrades()   {
       int nTrades;
    
       nTrades = 0;
       for(int i=0;i<OrdersTotal(); i++)  {
          OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
             if(OrderSymbol()==Symbol() && OrderComment()==Name_Expert) nTrades++;
             }
             return (nTrades);
             }
    
     
  5. red_devil_fans

    red_devil_fans
    Expand Collapse
    New Member

    Joined:
    Dec 15, 2008
    Messages:
    10
    Likes Received:
    0
    bos klo misalnya saya mw ngeclose klo ada posisi buy misalnya,

    itu gmana caranya bos white tiger??

    klo kayak gini bener g bos??

    if(ma5_1 < ma8_1 && ma5_2 > ma8_2)
    {
    OrderSend(Symbol(),OP_BUY,0.1,Ask,3,0,0,"My order #1",1,0,Green);
    }
    else if(ma5_1 > ma8_1 && ma5_2 < ma8_2)
    {
    OrderClose(OrderTicket(),OrderLots(),Ask, 0);
    OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"My order #2",1,0,Red);
    }
    if(ma5_1 < ma8_1 && ma5_2 > ma8_2)
    {
    OrderClose(OrderTicket(),OrderLots(),Bid, 0);
    }

    klo misalnya salah, tolong koreksinya y bos.

    thx.
     
  6. red_devil_fans

    red_devil_fans
    Expand Collapse
    New Member

    Joined:
    Dec 15, 2008
    Messages:
    10
    Likes Received:
    0
    bos white tiger!!

    need your help!!

    pleasee...:-/
     
  7. wongbejo

    wongbejo
    Expand Collapse
    New Member

    Joined:
    Dec 19, 2008
    Messages:
    11
    Likes Received:
    0
    Help me

    dear para master,

    saya mau nanya bagaimaan scriptnya untuk menghitung posisi high dan low nya candle dalam tf 15 m ?

    mohon pencerahannya. tk
     
  8. zainal

    zainal
    Expand Collapse
    New Member

    Joined:
    Jan 3, 2009
    Messages:
    11
    Likes Received:
    0
    help me make ea

    Salam kenal,
    saya mau buat EA tapi tidak bisa bahasa C++, sudah coba baca di forum tutorial mql4. tetap tdk bisa
    idenya beginihttp://www.forexindo.com/forum/images/smilies/ym/102.gif


    1. misal order #1 buy stoploss, maka
    2. order #2 sell dengan lot (2X order#1+los#1), jika TP kembali mulai order baru,
    senin-jumat trade kecuali jumat jam stop trade jam 18.00 waktu broker

    terima kasih atas bantuannya
     
  9. open1

    open1
    Expand Collapse
    New Member

    Joined:
    Jan 13, 2009
    Messages:
    3
    Likes Received:
    0
    tlg modify ea

    mas whitetiger, bisa minta tlg modify ea? atau ada saudara2 lain yg bisa? tlg ya. terima kasih
     
  10. white_tiger

    white_tiger
    Expand Collapse
    Administrator
    Staff Member

    Joined:
    Jun 13, 2007
    Messages:
    1,501
    Likes Received:
    4
    ngeclose klo ada posisi but itu maksudnya gimana?
     

Share This Page