Forex Community Place

Dapatkan hingga
$50000
karena mengundang teman
untuk memperoleh Bonus StartUp
dari InstaForex
Tidak perlu investasi!
Mulai trading tanpa
risiko dan investasi
Dengan Bonus Permulaan 1000$
Dapatkan bonus
55%
ke akun anda!
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 12

Thread: Cara Membuat Tombol Close All Order pada Chart

  1. #1
    Orang Asing
    ----
     
    proton99 is an unknown quantity at this point proton99's Avatar
    Join Date
    May 2016
    Posts
    2
    Accumulated bonus
    1 USD (What is this?)
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cara Membuat Tombol Close All Order pada Chart

    Saya ingin tanya sama master2 coding disini, bagaimana caranya membuat tombol Close All Order yang bisa tampil di chart, sehingga jika kita ingin close all order tinggal klik tombolnya saja dan semua order langsung di close, trims. (seperti contoh pada gambar)
    Attached Images  

  2. lamborghini
  3. #2
    Newbie
    ----
     
    id4799 is an unknown quantity at this point id4799's Avatar
    Join Date
    Oct 2016
    Posts
    26
    Accumulated bonus
    6 USD (What is this?)
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Bisa pakai cara ini gan
    PHP Code:

    //+------------------------------------------------------------------+
    //| ChartEvent function                                              |
    //+------------------------------------------------------------------+
    void OnChartEvent(const int id,
                      const 
    long &lparam,
                      const 
    double &dparam,
                      const 
    string &sparam)
      {
    //---
       
    if(id==CHARTEVENT_OBJECT_CLICK && sparam == "NAMA_OBJECT"){
        
    // buat perintah close disini
       
    }
      }
    //+------------------------------------------------------------------+ 

  4. The Following User Says Thank You to id4799 For This Useful Post:

    mas ahmad (01-03-2017)

  5. #3
    Orang Asing
    ----
     
    proton99 is an unknown quantity at this point proton99's Avatar
    Join Date
    May 2016
    Posts
    2
    Accumulated bonus
    1 USD (What is this?)
    Thanks
    0
    Thanked 0 Times in 0 Posts
    terima kasih atas bantuannya agan id4799, saya coba dulu.

    ---------- Post added at 06:23 AM ---------- Previous post was at 05:55 AM ----------

    Gan saya sudah coba seperti ini :
    //+------------------------------------------------------------------+
    //| ChartEvent function |
    //+------------------------------------------------------------------+
    void OnChartEvent(const int id,
    const long &lparam,
    const double &dparam,
    const string &sparam)
    {
    if(id==CHARTEVENT_OBJECT_CLICK && sparam == "NAMA_OBJECT")
    {if (CloseAllNow) {CloseAll(Magic, 7); CloseAll(MagicTrending, 7);return (0);}
    }
    }
    //+------------------------------------------------------------------+

    tapi masih ada errornya : 'OnChartEvent' - function can be declared only in the global scope
    salah dimananya ya..? mohon bantuannya dong para agan master semua, trims.

  6. #4
    Newbie
    ----
     
    id4799 is an unknown quantity at this point id4799's Avatar
    Join Date
    Oct 2016
    Posts
    26
    Accumulated bonus
    6 USD (What is this?)
    Thanks
    0
    Thanked 6 Times in 6 Posts
    coba agan bandingkan dengan ini
    PHP Code:
    #property strict
    string objBtnClose "btnClose";

    int OnInit() {
      if (!
    ObjectCreate(0objBtnCloseOBJ_BUTTON000)) {
        
    Alert("Tidak bisa membuat object! error code="GetLastError());
        return 
    INIT_FAILED;
      }
      
    ObjectSetString(0objBtnClose,OBJPROP_TEXT,"Close");
      
      return (
    INIT_SUCCEEDED);
    }

    void OnDeinit(const int reason) {
      
    EventKillTimer();
      
    ObjectDelete(0objBtnClose);
    }

    void OnTick() {}

    void OnChartEvent(const int id, const long &lparam, const double &dparam,
                      const 
    string &sparam) {

      if (
    id == CHARTEVENT_OBJECT_CLICK && sparam == objBtnClose) {
        
    objBtnCloseClick();
      }
    }

    // PERINTAH CLOSE ORDERS
    void objBtnCloseClick() {
      
      
    // Konfirmasi  
      
    if(MessageBox("Tutup semua order?","Confirm",MB_YESNO)==IDYES){
        
    Alert("CLOSING...");
      }
      
      
    Sleep(50);
      
    ObjectSetInteger(0objBtnCloseOBJPROP_STATE0);

    Last edited by id4799; 10-21-2016 at 10:00.

  7. #5
    Forum Resident
    Doh
     
    pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar's Avatar
    Join Date
    Oct 2011
    Location
    indonesia
    Posts
    5,632
    Accumulated bonus
    4291 USD (What is this?)
    Saya bertemu tamu
    26 (detail lebih lanjut)
    Thanks
    9,266
    Thanked 4,797 Times in 1,793 Posts
    Quote Originally Posted by proton99     
    terima kasih atas bantuannya agan id4799, saya coba dulu.

    ---------- Post added at 06:23 AM ---------- Previous post was at 05:55 AM ----------

    Gan saya sudah coba seperti ini :
    //+------------------------------------------------------------------+
    //| ChartEvent function |
    //+------------------------------------------------------------------+
    void OnChartEvent(const int id,
    const long &lparam,
    const double &dparam,
    const string &sparam)
    {
    if(id==CHARTEVENT_OBJECT_CLICK && sparam == "NAMA_OBJECT")
    {if (CloseAllNow) {CloseAll(Magic, 7); CloseAll(MagicTrending, 7);return (0);}
    }
    }
    //+------------------------------------------------------------------+

    tapi masih ada errornya : 'OnChartEvent' - function can be declared only in the global scope
    salah dimananya ya..? mohon bantuannya dong para agan master semua, trims.
    koreksinya di situ bro. hal wajar jika pas kompile masih eror, jika mungkin kurang titik, koma, kurung kurawa, atau bahkan kelebihan, sebagai pemula ane juga sering seperti ini, coba di bandingkan dengan agan id4799, di situ alurnya lebih lebih perintahnya
    Happy green pips semua ya

  8. #6
    Pecandu
    Lelah
     
    murondi is on a distinguished road murondi's Avatar
    Join Date
    Sep 2014
    Posts
    440
    Accumulated bonus
    128 USD (What is this?)
    Thanks
    16
    Thanked 22 Times in 20 Posts
    wah apa gak bahaya gan,, kalau sedang floating minus banyak tanpa sengaja kepencet close all.. apa gak lebih baik close all manual menurut ane lebih aman.. kecuali pakai scalping...

  9. #7
    Newbie
    ----
     
    id4799 is an unknown quantity at this point id4799's Avatar
    Join Date
    Oct 2016
    Posts
    26
    Accumulated bonus
    6 USD (What is this?)
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Quote Originally Posted by murondi     
    wah apa gak bahaya gan,, kalau sedang floating minus banyak tanpa sengaja kepencet close all.. apa gak lebih baik close all manual menurut ane lebih aman.. kecuali pakai scalping...
    betul gan.. makanya di beri pesan konfirmasi
    PHP Code:
      // Konfirmasi  
      
    if(MessageBox("Tutup semua order?","Confirm",MB_YESNO)==IDYES){
        
    Alert("CLOSING...");
      } 

  10. The Following User Says Thank You to id4799 For This Useful Post:

    pemburu dolar (10-22-2016)

  11. #8
    Orang Lama
    Berani
     
    wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso has a brilliant future wong endeso's Avatar
    Join Date
    Feb 2012
    Posts
    995
    Accumulated bonus
    784 USD (What is this?)
    Saya bertemu tamu
    7 (detail lebih lanjut)
    Thanks
    1,636
    Thanked 1,659 Times in 588 Posts
    Quote Originally Posted by id4799     
    coba agan bandingkan dengan ini
    PHP Code:
    #property strict
    string objBtnClose "btnClose";

    int OnInit() {
      if (!
    ObjectCreate(0objBtnCloseOBJ_BUTTON000)) {
        
    Alert("Tidak bisa membuat object! error code="GetLastError());
        return 
    INIT_FAILED;
      }
      
    ObjectSetString(0objBtnClose,OBJPROP_TEXT,"Close");
      
      return (
    INIT_SUCCEEDED);
    }

    void OnDeinit(const int reason) {
      
    EventKillTimer();
      
    ObjectDelete(0objBtnClose);
    }

    void OnTick() {}

    void OnChartEvent(const int id, const long &lparam, const double &dparam,
                      const 
    string &sparam) {

      if (
    id == CHARTEVENT_OBJECT_CLICK && sparam == objBtnClose) {
        
    objBtnCloseClick();
      }
    }

    // PERINTAH CLOSE ORDERS
    void objBtnCloseClick() {
      
      
    // Konfirmasi  
      
    if(MessageBox("Tutup semua order?","Confirm",MB_YESNO)==IDYES){
        
    Alert("CLOSING...");
      }
      
      
    Sleep(50);
      
    ObjectSetInteger(0objBtnCloseOBJPROP_STATE0);

    ini masuknya ke indikator scrip apa EA om? trus cara masukkan ke MT4 gmn ya ?
    maaf g faham sama sekali pemograman

  12. #9
    Forum Resident
    Doh
     
    pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar has a reputation beyond repute pemburu dolar's Avatar
    Join Date
    Oct 2011
    Location
    indonesia
    Posts
    5,632
    Accumulated bonus
    4291 USD (What is this?)
    Saya bertemu tamu
    26 (detail lebih lanjut)
    Thanks
    9,266
    Thanked 4,797 Times in 1,793 Posts
    Quote Originally Posted by wong endeso     
    ini masuknya ke indikator scrip apa EA om? trus cara masukkan ke MT4 gmn ya ?
    maaf g faham sama sekali pemograman
    script kali bro, buka aja metatradernya dulu- tekan tombol f4( ini cara cepatnya) atau detailnya ke tool-metaquote editor-klik itu icon "new" ntar bisa di pilih yang script , tekan next, kasih nama script nya, next lagi, terus paste tuch semua coding di atas, click compile, kalau gak ada error berarti anda sukses, dan script bisa di gunakan, selamat mencoba,,cmiiw
    Happy green pips semua ya

  13. <a href="https://www.mt5.com/id/">Forex Portal MT5</a>
  14. #10
    Orang Asing
     Geli
     
    ucok654 is an unknown quantity at this point ucok654's Avatar
    Join Date
    May 2016
    Posts
    5
    Accumulated bonus
    2 USD (What is this?)
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by pemburu dolar     
    script kali bro, buka aja metatradernya dulu- tekan tombol f4( ini cara cepatnya) atau detailnya ke tool-metaquote editor-klik itu icon "new" ntar bisa di pilih yang script , tekan next, kasih nama script nya, next lagi, terus paste tuch semua coding di atas, click compile, kalau gak ada error berarti anda sukses, dan script bisa di gunakan, selamat mencoba,,cmiiw
    neh emang source code script bisa buat script, ea bahkan file mqh
    wkwkwkw ingatan hardisk gw balik lagi,,,

Page 1 of 2
1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts