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

Mohon Bantuannya Modif EA

Discussion in 'Belajar MQL dari Nol' started by www.geniusnewsystem.com, 17 May 2020.

  1. www.geniusnewsystem.com

    www.geniusnewsystem.com New Member

    Equity
    Credit
    Ref Point
    Mohon bantuannya hu, saya mau menambahkan fitur Close All Posisi di Jam Tertentu Perlu di tambahkan kode apa ya,
     
  2. stadevata

    stadevata Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    -----------------
    //bagian input
    ----------------
    input int Magic_Number = 12345;
    input string jamCA = "00:00";
    datetime jamClose;


    ------------------------
    //bagian fungsi
    -----------------------
    jamClose = StrToTime(jamCA);
    for(int i=OrdersTotal()-1; i>=0; i--)
    {
    if(!OrderSelect(i,SELECT_BY_POS)) continue;
    if(OrderType()<=1 && OrderMagicNumber()==Magic_Number && TimeLocal() == jamClose)
    ticket=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),5);
    }
     

Share This Page