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

Question Bantuan Edit Script untuk jebakan Berita

Discussion in 'Belajar MQL dari Nol' started by Abi Manyu, 15 Nov 2015.

  1. Abi Manyu

    Abi Manyu Member Credit Hunter

    Equity
    Credit
    Ref Point
    Permisi master-master,
    Selamat Malam salam profit untuk semua,

    Mohon bantuannya master, untuk mengedit atau lebih tepatnya menambahkan koding atas script yang saya buat untuk jebakan news.
    Code:
    //+------------------------------------------------------------------+
    //|                                          AA_Script_TrapNews.mq4 |
    //|                                        Copyright 2015, Abimanyu. |
    //|                                https://www.facebook.com/m4nyunz |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2015, Abimanyu."
    #property link      "https://www.facebook.com/m4nyunz"
    #property version  "1.00"
    #property strict
    
    //====================================================================================================
    extern string Step_PO = "Jarak pending order dr skrg";
    extern int	  SL	    = 10;
    extern int	  TP	    = 50;
    extern int Risk = 50;
    extern double Step01	 = 15.0,  LOT01  = 1.0,
                  Step02	 = 25.0,  LOT02  = 2.0,
                  Step03	 = 35.0,  LOT03  = 3.0,
                  Step04	 = 40.0,  LOT04  = 4.0,
                  Step05	 = 45.0,  LOT05  = 5.0;
    int	  ticket;
    double  myPoint, myBid, myAsk,
            PriceSell1 , PriceSell2 , PriceSell3 , PriceSell4 , PriceSell5 ,
            PriceBuy1  , PriceBuy2  , PriceBuy3  , PriceBuy4  , PriceBuy5  ;
    
    //====================================================================================================
    int start()
      {
      myPoint  = MarketInfo(Symbol(),MODE_POINT);
      myBid    = MarketInfo(Symbol(),MODE_BID);
      myAsk    = MarketInfo(Symbol(),MODE_ASK);
      PriceSell1  = myBid-Step01*myPoint;  PriceBuy1  = myAsk+Step01*myPoint;
      PriceSell2  = myBid-Step02*myPoint;  PriceBuy2  = myAsk+Step02*myPoint;
      PriceSell3  = myBid-Step03*myPoint;  PriceBuy3  = myAsk+Step03*myPoint;
      PriceSell4  = myBid-Step04*myPoint;  PriceBuy4  = myAsk+Step04*myPoint;
      PriceSell5  = myBid-Step05*myPoint;  PriceBuy5  = myAsk+Step05*myPoint;
      while(true) {
          ticket=OrderSend(Symbol(),OP_SELLSTOP,LOT01,PriceSell1 ,0,PriceSell1 +SL*myPoint,PriceSell1 -TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_BUYSTOP ,LOT01,PriceBuy1  ,0,PriceBuy1  -SL*myPoint,PriceBuy1  +TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_SELLSTOP,LOT02,PriceSell2 ,0,PriceSell2 +SL*myPoint,PriceSell2 -TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_BUYSTOP ,LOT02,PriceBuy2  ,0,PriceBuy2  -SL*myPoint,PriceBuy2  +TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_SELLSTOP,LOT03,PriceSell3 ,0,PriceSell3 +SL*myPoint,PriceSell3 -TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_BUYSTOP ,LOT03,PriceBuy3  ,0,PriceBuy3  -SL*myPoint,PriceBuy3  +TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_SELLSTOP,LOT04,PriceSell4 ,0,PriceSell4 +SL*myPoint,PriceSell4 -TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_BUYSTOP ,LOT04,PriceBuy4  ,0,PriceBuy4  -SL*myPoint,PriceBuy4  +TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_SELLSTOP,LOT05,PriceSell5 ,0,PriceSell5 +SL*myPoint,PriceSell5 -TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          ticket=OrderSend(Symbol(),OP_BUYSTOP ,LOT05,PriceBuy5  ,0,PriceBuy5  -SL*myPoint,PriceBuy5  +TP*myPoint,"AA_TebarProfit",0,0,clrNONE);
          if(ticket<=0) Print("Error = ",GetLastError());
          else { Print("ticket = ",ticket); break; }
          Sleep(10000);}
      return(0);
    }
    ditambahkan fungsi auto lot berdasarkan sisa Equity dengan penggunaan Risk ( jadi yang nanti bisa di input hanya SL, TP, Risk, Step saja ). untuk perhitungannya saya buat di excell namun bingung untuk menambahkan di scriptnya bagaimana.

    mungkin para master jago koding bisa berbaik hati mengajarkan saya atau langsung di edit aja scriptnya.

    File Excell dan Scriptnya saya lampirkan juga nih master.

    Terimakasih,
    Salam Profit Indonesia.
     

    Attached Files:

    • Like Like x 1
  2. mahoo bar

    mahoo bar Member Credit Hunter

    Equity
    Credit
    Ref Point
    baca excel tp masih gak nggak mudeng ya :sweating:
     
  3. farich

    farich Member Credit Hunter

    Equity
    Credit
    Ref Point
    Scrip ini bakalan jadi perampok kalo udah sempurna, mantap master mohon di sempurnakan :Ok:
    saya juga bingung bagaimana cara men seting waktunya ketika news impack datang?
     
    Last edited: 24 Nov 2015
  4. mahoo bar

    mahoo bar Member Credit Hunter

    Equity
    Credit
    Ref Point
    sorry tambah gak mudeng om...lha script kok disetting waktunya, waktu yg mana maksudnya?
     
  5. Abi Manyu

    Abi Manyu Member Credit Hunter

    Equity
    Credit
    Ref Point
    kurang mengerti dibagian mananya om...?, kita bahas disini om yang g ngertinya jadi setelah mengerti kan mungkin om bisa bantu editkan scriptnya xixiiii

    iya om, kalau sudah di setting auto lot, baru ditambahkan lagi fungsi yang lain dan di terapkan sebagai EA bukan sebagai script lg

    maksudnya kalau sudah terjawab, baru dirubah ke EA dan ditambahkan setting waktu penyebarannya om.
     
  6. mahoo bar

    mahoo bar Member Credit Hunter

    Equity
    Credit
    Ref Point
    itu yg di excel maksudnya apa cuma mencari yang berwarna kuning ya om, misalkan dirubah % nya
     
  7. Abi Manyu

    Abi Manyu Member Credit Hunter

    Equity
    Credit
    Ref Point
    iya om jadi nanti yang dapat user rubah hanya Risk dalam % nya saja nanti kolom yang berwarna kuning sudah automatis terisi
     
  8. mahoo bar

    mahoo bar Member Credit Hunter

    Equity
    Credit
    Ref Point
    berarti jarak sama stepnya nilainya gak berubah?
     
  9. Abi Manyu

    Abi Manyu Member Credit Hunter

    Equity
    Credit
    Ref Point
    wah boleh juga tuh om kalau bisa dirubah. saya tidak kefikiran untuk merubah jarak step sih soalnya.
     
  10. mahoo bar

    mahoo bar Member Credit Hunter

    Equity
    Credit
    Ref Point
    saya coba cari inspirasi dulu ya om... maklum masih pemula...
     
  11. Abi Manyu

    Abi Manyu Member Credit Hunter

    Equity
    Credit
    Ref Point
    siap om, ditunggu om editannya....
     
  12. mahoo bar

    mahoo bar Member Credit Hunter

    Equity
    Credit
    Ref Point
    rumus di excel kok nyambung semua ya om, maks lot , lot saat ini, eq saat ini ? itu maksud alurnya gimana ya, mungkin pake kata" jadi bisa lebih membantu, misalnya
    jika equity 3000 max lot sekian...dst...dst..
     
    Last edited: 24 Nov 2015
  13. Abi Manyu

    Abi Manyu Member Credit Hunter

    Equity
    Credit
    Ref Point
    itu hanya untuk cek dan ricek aja om...
     
  14. mahoo bar

    mahoo bar Member Credit Hunter

    Equity
    Credit
    Ref Point
    gagal paham om
     
  15. Abi Manyu

    Abi Manyu Member Credit Hunter

    Equity
    Credit
    Ref Point
    iya om nnti ane gunakan kata-kata agar lebih mudah dipahami, setelah ane sampai, masih di jalan soalnya
     

Share This Page