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 2 of 4
FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 32

Thread: [need help]Script Open Posisi dengan SL, TP, MM

  1. #11
    Knuckle Gesit
    Lelah
     
    pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit's Avatar
    Join Date
    Aug 2011
    Location
    selalu di depan laptop
    Posts
    1,172
    Accumulated bonus
    232 USD (What is this?)
    Thanks
    147
    Thanked 975 Times in 486 Posts
    eh.. ternyata keliru.. bukan tick size.. tapi tick value.. ahahhaha
    sekarang sudah bener nih..
    Code:
    //+------------------------------------------------------------------+
    //|                                              belum ada judul.mq4 |
    //|                                                    Pengen Profit |
    //|                                                                  |
    //+------------------------------------------------------------------+
    #property copyright "Pengen Profit"
    #property link      ""
    #property show_inputs
    #include <stderror.mqh>
    #include <stdlib.mqh> 
    //+------------------------------------------------------------------+
    //| script program start function                                    |
    //+------------------------------------------------------------------+
    
    //----//parameternya ini, input-nya ini
    extern double Persen_Margin=5;
    extern bool buy=false;
    extern bool sell=false;
    extern int TP=0;  //  boleh di isi angka.. boleh nol.. bebas...
    extern int SL=0;
    extern int slippage=3;
    extern string LotStatic= "jika di isi 0 maka pake MM";
    extern double Lotstatic=0;
    extern string comen=" apa ya??? ";
    extern int magic= 7455458438884855;
    int digit;
    double Lot, minlot, maxlot, lotstep, margin, LOT;                
    
    
    //(c)2010 eninefx
    int start()
      {  //int dg=1;
      //if (Digits==3 || Digits==5){ dg=10;}
      
       margin   = MarketInfo(Symbol(), MODE_MARGINREQUIRED);
       minlot   = MarketInfo(Symbol(), MODE_MINLOT);
       maxlot   = MarketInfo(Symbol(), MODE_MAXLOT);
       lotstep  = MarketInfo(Symbol(), MODE_LOTSTEP);
       double tick= MarketInfo(Symbol(), MODE_TICKVALUE);
       if(lotstep==0.1)  digit=1;
       if(lotstep==0.01)  digit=2;
       if(lotstep==0.001)  digit=3;
       
       Lot = NormalizeDouble( ( (Persen_Margin/100*AccountBalance())/margin)/tick, digit);
      
       if (Lotstatic==0){ LOT = Lot;}
       if (Lotstatic!=0){ LOT = Lotstatic;}
        Alert( " LOT = "+ LOT);
       if (buy){ ngebuy();}
       if (sell) { ngesell();}
     
       return(0);
      }
      
    //--------------------------------------------------------  
      
      void ngebuy()
     {  if (Digits==2||Digits==4) 
           { double tepe = Ask+TP*Point, esel=Ask-SL*Point;
            if (TP==0){ tepe=0;}
            if (SL==0){ esel=0;}
            OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage,esel,tepe,comen,magic,0);
            Alert(" buy  = ", ErrorDescription( GetLastError()));  
           }
        if (Digits==3||Digits==5)
             {  
             
             int zz = OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage*10,0,0,comen,magic,0);
             Alert(" buy  = ", ErrorDescription( GetLastError()));  
              if (zz>0) 
               { OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 tepe = OrderOpenPrice()+TP*Point*10; esel=OrderOpenPrice()-SL*Point*10;
                 if (TP==0){ tepe=0;}
                 if (SL==0){ esel=0;}
                
                 OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                 Alert(" modif tp sl  = ", ErrorDescription( GetLastError()));       
               }
            }    
     }
             
    //--------------------------------------         
      void ngesell()
     {  if (Digits==2||Digits==4) 
           { double tepe = Bid-TP*Point, esel=Bid+SL*Point;
            if (TP==0){ tepe=0;}
            if (SL==0){ esel=0;}
            OrderSend(Symbol(),OP_BUY,LOT,Bid,slippage,esel,tepe,comen,magic,0); 
            Alert(" sell  = ", ErrorDescription( GetLastError()));  
           }
        if (Digits==3||Digits==5)
             {  
             
             int zz = OrderSend(Symbol(),OP_BUY,LOT,Bid,slippage*10,0,0,comen,magic,0);
             Alert(" sell  = ", ErrorDescription( GetLastError()));  
              if (zz>0) 
               { OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 tepe = OrderOpenPrice()-TP*Point*10; esel=OrderOpenPrice()+SL*Point*10;
                 if (TP==0){ tepe=0;}
                 if (SL==0){ esel=0;}
                
                 OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                 Alert(" modify TP SL  = ", ErrorDescription( GetLastError()));       
               }
            }    
     }
       
       //--------------------------------------------------------------

  2. The Following 2 Users Say Thank You to pengen-profit For This Useful Post:

    FXri (05-07-2012)

  3. <a href="">Forex Portal MT5</a>
  4. #12
    Penggemar
    ----
     
    Gathot007 will become famous soon enough Gathot007 will become famous soon enough Gathot007's Avatar
    Join Date
    Jan 2012
    Location
    KampuS TradeR
    Posts
    293
    Accumulated bonus
    43 USD (What is this?)
    Thanks
    60
    Thanked 102 Times in 64 Posts
    Quote Originally Posted by FXri     
    gini maksudnya Om...jadi perhitungan lot ketika dibuka menggunakan presentase MM itu tidak terpengaruh dengan SL. Jadi misal modal $100, terus buka posisi dengan MM 10% dengan leverage 1:1000 maka di insta akan membuat posisi dengan lot sebesar 1.0, atau senilai dengan $1

    sebenernya saya ada script yang bagi saya MMnya udah sesuai dengan yang saya inginkan, tapi masih belum ada fitur seperti yang saya tulis di atas. Dan script ini hanya bisa digunakan di broker insta doank
    ini codenya Om, mungkin bisa dioprek sama Om Gatot biar bisa ada fitur seperti di atas :
    PHP Code:
    //+------------------------------------------------------------------+
    //|                                             Buy_Contest_1_OP.mq4 |
    //+------------------------------------------------------------------+
    #property copyright "Copyright © 2010, eninefx."
    #property link      "http://www.kaskus.us/showthread.php?t=3967467&page=350"

    //versi 2.0 - 25-mei-2010

    //munculkan parameter input
    #property show_inputs

    #include <stderror.mqh>
    #include <stdlib.mqh>

    //parameternya ini, input-nya ini
    extern double  TP              100.0;

    extern double Persen_Margin=5;

    int digit;
    double Lotminlotmaxlotlotstepmargin;                


    //(c)2010 eninefx
    int start()
      {  
       
    margin   MarketInfo(Symbol(), MODE_MARGINREQUIRED);
       
    minlot   MarketInfo(Symbol(), MODE_MINLOT);
       
    maxlot   MarketInfo(Symbol(), MODE_MAXLOT);
       
    lotstep  MarketInfo(Symbol(), MODE_LOTSTEP);
       if(
    lotstep==0.1)  digit=1;
       if(
    lotstep==0.01)  digit=2;
       if(
    lotstep==0.001)  digit=3;
       
       
    Lot NormalizeDouble((Persen_Margin/100*AccountBalance())/margindigit);
       
    RefreshRates();
       while( 
    IsTradeContextBusy() ) { Sleep(100); }
    //----
       
    int ticket=OrderSend(Symbol(),OP_BUY,Lot,Ask,3,0,Ask+TP*Point,"profit",1,0,CLR_NONE);
       if(
    ticket<1)
         {
          
    int error=GetLastError();
          Print(
    "Error = ",ErrorDescription(error));
          return;
         }
    //----
       
    OrderPrint();
       return(
    0);
      } 
    oke bro ane adopsi hitungan lotnya
    silahkan dicoba ane sih belum sempat nyoba
    Spoiler Spoiler:
    PHP Code:
    //+------------------------------------------------------------------+
    //|                                                       Buy MM.mq4 |
    //|                                                          free    |
    //+------------------------------------------------------------------+
    #property copyright "Gathot_007"
    #include <stdlib.mqh>
    #property show_inputs

    extern bool MM=true;
    extern double MM_persen=2;
    extern double lots=0.01;
    extern bool  UseSL=true;
    extern double SL=20;
    extern bool UseTP=true;
    extern double TP=40;
    extern string NComment="buy_Gath";
    double LL,pn,margin;
    int ticket;
    //+------------------------------------------------------------------+
    //| script "transaksi untuk semua pairs"                                   |
    //+------------------------------------------------------------------+
    int start()
      {
    margin   MarketInfo(Symbol(), MODE_MARGINREQUIRED);
    if(
    MMLL=NR(AccountBalance()*MM_persen/100/margin); else LL=NR(lots);
       if(!
    UseSL &&!UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,0,0,"NComment",777,0,CLR_NONE);
       if( 
    UseSL && !UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,Ask-SL*pp(),0,"NComment",777,0,CLR_NONE);
       if(!
    UseSL && UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,0,Ask+TP*pp(),"NComment",777,0,CLR_NONE);
       if(
    UseSL && UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,Ask-SL*pp(),Ask+TP*pp(),"NComment",777,0,CLR_NONE);
       if(
    ticket<1)
         {
          
    int error=GetLastError();
          Print(
    "Error = ",ErrorDescription(error));
          return;
         }
    //----
       
    OrderPrint();
       return(
    0);
      }
    double NR(double gath)
    {
        
    double maxlots MarketInfo(Symbol(), MODE_MAXLOT),
        
    minilot MarketInfo(Symbol(), MODE_MINLOT), 
        
    lstep MarketInfo(Symbol(), MODE_LOTSTEP);
        
    double lots lstep NormalizeDouble(gath lstep0);
        
    lots MathMax(MathMin(maxlotslots), minilot);
        return (
    lots);
    }
    double pp()
    {
    if(
    Digits==|| Digits==5pn=10*Point;else pn=Point;
    return(
    pn);


  5. The Following User Says Thank You to Gathot007 For This Useful Post:

    FXri (05-07-2012)

  6. #13
    Poster Lama
    Bahagia
     
    FXri is a jewel in the rough FXri is a jewel in the rough FXri is a jewel in the rough FXri is a jewel in the rough FXri's Avatar
    Join Date
    Jul 2010
    Location
    http://fxri.blogspot.com/
    Posts
    3,479
    Accumulated bonus
    788 USD (What is this?)
    Thanks
    217
    Thanked 406 Times in 323 Posts
    pengen-profit,
    Gathot007,

    makasih Om...bentar ya saya coba dulu satu-satu

    update setelah dicoba :
    yang dari Om Pengen Profit sukses eksekusi buy dan sell di broker 4 digit dan 5 digit kalo TP dan SL di kasih 0 dan pake lot static, tapi kalo pake SL, TP, atau Lotnya dikasih 0.00 (pake MM) jadi eror.

    yang dari Om Gathot masih belum mau buka posisi Om.

  7. #14
    Knuckle Gesit
    Lelah
     
    pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit's Avatar
    Join Date
    Aug 2011
    Location
    selalu di depan laptop
    Posts
    1,172
    Accumulated bonus
    232 USD (What is this?)
    Thanks
    147
    Thanked 975 Times in 486 Posts
    oh iya punya ane lupa ngasih minimal lot sama maximal lotnya..
    setelah di koreksi.. jadinya begini.. semoga puas ya...

    Code:
    //+------------------------------------------------------------------+
    //|                                              belum ada judul.mq4 |
    //|                                                    Pengen Profit |
    //|                                                                  |
    //+------------------------------------------------------------------+
    #property copyright "Pengen Profit"
    #property link      ""
    #property show_inputs
    #include <stderror.mqh>
    #include <stdlib.mqh> 
    //+------------------------------------------------------------------+
    //| script program start function                                    |
    //+------------------------------------------------------------------+
    
    //----//parameternya ini, input-nya ini
    extern double Persen_Margin=5;
    extern bool buy=false;
    extern bool sell=false;
    extern int TP=0;  //  boleh di isi angka.. boleh nol.. bebas...
    extern int SL=0;
    extern int slippage=3;
    extern string LotStatic= "jika di isi 0 maka pake MM";
    extern double Lotstatic=0;
    extern string comen=" apa ya??? ";
    extern int magic= 7455458438884855;
    int digit;
    double Lot, minlot, maxlot, lotstep, margin, LOT;                
    
    
    //(c)2010 eninefx
    int start()
      {  //int dg=1;
      //if (Digits==3 || Digits==5){ dg=10;}
      
       margin   = MarketInfo(Symbol(), MODE_MARGINREQUIRED);
       minlot   = MarketInfo(Symbol(), MODE_MINLOT);
       maxlot   = MarketInfo(Symbol(), MODE_MAXLOT);
       lotstep  = MarketInfo(Symbol(), MODE_LOTSTEP);
       double tick= MarketInfo(Symbol(), MODE_TICKVALUE);
       if(lotstep==0.1)  digit=1;
       if(lotstep==0.01)  digit=2;
       if(lotstep==0.001)  digit=3;
       
       Lot = NormalizeDouble( ( (Persen_Margin/100*AccountBalance())/margin)/tick, digit);
       
       if (Lot<minlot){ Lot=minlot;}
       if (Lot>maxlot){ Lot=maxlot;}
      
       if (Lotstatic==0){ LOT = Lot;}
       if (Lotstatic!=0){ LOT = Lotstatic;}
        Alert( " LOT = "+ LOT);
       if (buy){ ngebuy();}
       if (sell) { ngesell();}
     
       return(0);
      }
      
    //--------------------------------------------------------  
      
      void ngebuy()
     {  if (Digits==2||Digits==4) 
           { double tepe = Ask+TP*Point, esel=Ask-SL*Point;
            if (TP==0){ tepe=0;}
            if (SL==0){ esel=0;}
            OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage,esel,tepe,comen,magic,0);
            Alert(" buy  = ", ErrorDescription( GetLastError()));  
           }
        if (Digits==3||Digits==5)
             {  
             
             int zz = OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage*10,0,0,comen,magic,0);
             Alert(" buy  = ", ErrorDescription( GetLastError()));  
              if (zz>0) 
               { OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 tepe = OrderOpenPrice()+TP*Point*10; esel=OrderOpenPrice()-SL*Point*10;
                 if (TP==0){ tepe=0;}
                 if (SL==0){ esel=0;}
                
                 OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                 Alert(" modif tp sl  = ", ErrorDescription( GetLastError()));       
               }
            }    
     }
             
    //--------------------------------------         
      void ngesell()
     {  if (Digits==2||Digits==4) 
           { double tepe = Bid-TP*Point, esel=Bid+SL*Point;
            if (TP==0){ tepe=0;}
            if (SL==0){ esel=0;}
            OrderSend(Symbol(),OP_BUY,LOT,Bid,slippage,esel,tepe,comen,magic,0); 
            Alert(" sell  = ", ErrorDescription( GetLastError()));  
           }
        if (Digits==3||Digits==5)
             {  
             
             int zz = OrderSend(Symbol(),OP_BUY,LOT,Bid,slippage*10,0,0,comen,magic,0);
             Alert(" sell  = ", ErrorDescription( GetLastError()));  
              if (zz>0) 
               { OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 tepe = OrderOpenPrice()-TP*Point*10; esel=OrderOpenPrice()+SL*Point*10;
                 if (TP==0){ tepe=0;}
                 if (SL==0){ esel=0;}
                
                 OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                 Alert(" modify TP SL  = ", ErrorDescription( GetLastError()));       
               }
            }    
     }
       
       //--------------------------------------------------------------

  8. #15
    Knuckle Gesit
    Lelah
     
    pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit's Avatar
    Join Date
    Aug 2011
    Location
    selalu di depan laptop
    Posts
    1,172
    Accumulated bonus
    232 USD (What is this?)
    Thanks
    147
    Thanked 975 Times in 486 Posts
    wkwkwkkw.. iya.. sorry sorry.. coba lihat.. yang tadi.. dalam VOID NGESELL() nya.. perintahnya OP BUY semua.. wkwkwkwk
    makanya ane nyoba kok waktu SELL.. mesti error.. wkwkwkwk..

    yang ini di jamin deh..
    sudah ane tambahin refresh rates.. siapa tahu langsung pasang 2 arah.. biasanya kalo ga di kasih refresh rates.. habis pasang buy.. terus pas masang sell nya harga sudah keburu berubah.. jadinya error INVALID PRICE

    PHP Code:
    //+------------------------------------------------------------------+
    //|                                              belum ada judul.mq4 |
    //|                                                    Pengen Profit |
    //|                                                                  |
    //+------------------------------------------------------------------+
    #property copyright "Pengen Profit"
    #property link      ""
    #property show_inputs
    #include <stderror.mqh>
    #include <stdlib.mqh> 
    //+------------------------------------------------------------------+
    //| script program start function                                    |
    //+------------------------------------------------------------------+

    //----//parameternya ini, input-nya ini
    extern double Persen_Margin=5;
    extern bool buy=false;
    extern bool sell=false;
    extern int TP=0;  //  boleh di isi angka.. boleh nol.. bebas...
    extern int SL=0;
    extern int slippage=3;
    extern string LotStatic"jika di isi 0 maka pake MM";
    extern double Lotstatic=0;
    extern string comen=" apa ya??? ";
    extern int magic7455458438884855;
    int digit;
    double LotminlotmaxlotlotstepmarginLOT;                


    //(c)2010 eninefx
    int start()
      {  
    //int dg=1;
      //if (Digits==3 || Digits==5){ dg=10;}
      
       
    margin   MarketInfo(Symbol(), MODE_MARGINREQUIRED);
       
    minlot   MarketInfo(Symbol(), MODE_MINLOT);
       
    maxlot   MarketInfo(Symbol(), MODE_MAXLOT);
       
    lotstep  MarketInfo(Symbol(), MODE_LOTSTEP);
       
    double tickMarketInfo(Symbol(), MODE_TICKVALUE);
       if(
    lotstep==0.1)  digit=1;
       if(
    lotstep==0.01)  digit=2;
       if(
    lotstep==0.001)  digit=3;
       
       
    Lot NormalizeDouble( ( (Persen_Margin/100*AccountBalance())/margin)/tickdigit);
       
       if (
    Lot<minlot){ Lot=minlot;}
       if (
    Lot>maxlot){ Lot=maxlot;}
      
       if (
    Lotstatic==0){ LOT Lot;}
       if (
    Lotstatic!=0){ LOT Lotstatic;}
        
    Alert" LOT = "DoubleToStr(LOT,2));
       if (
    buy){ ngebuy();}
       if (
    sell) { ngesell();}
     
       return(
    0);
      }
      
    //--------------------------------------------------------  
      
      
    void ngebuy()
     {    
    RefreshRates();
         if (
    Digits==2||Digits==4
           { 
    double tepe Ask+TP*Pointesel=Ask-SL*Point;
            if (
    TP==0){ tepe=0;}
            if (
    SL==0){ esel=0;}
            
    OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage,esel,tepe,comen,magic,0);
           
    Alert(" buy @ = "+DoubleToStr(Ask,Digits)+" TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"     "ErrorDescriptionGetLastError()));  
            }
         if (
    Digits==3||Digits==5)
             {  
             
             
    int zz OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage*10,0,0,comen,magic,0);
             
    Alert(" buy  @ "+DoubleToStr(Ask,Digits)+"    "ErrorDescriptionGetLastError()));  
              if (
    zz>0
               { 
    OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 
    tepe OrderOpenPrice()+TP*Point*10esel=OrderOpenPrice()-SL*Point*10;
                 if (
    TP==0){ tepe=0;}
                 if (
    SL==0){ esel=0;}
                
                 
    OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                 
    Alert(" modif TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"     "ErrorDescriptionGetLastError()));       
               }
            }    
     }
             
    //--------------------------------------         
      
    void ngesell()
     {    
    RefreshRates();
          if (
    Digits==2||Digits==4
           { 
    double tepe Bid-TP*Pointesel=Bid+SL*Point;
            if (
    TP==0){ tepe=0;}
            if (
    SL==0){ esel=0;}
            
    OrderSend(Symbol(),OP_SELL,LOT,Bid,slippage,esel,tepe,comen,magic,0); 
            
    Alert(" sell @ = "+DoubleToStr(Bid,Digits)+" TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"    "ErrorDescriptionGetLastError()));  
           }
        if (
    Digits==3||Digits==5)
             {  
             
             
    int zz OrderSend(Symbol(),OP_SELL,LOT,Bid,slippage*10,0,0,comen,magic,0);
             
    Alert(" sell  @ "+DoubleToStr(Bid,Digits)+"    "ErrorDescriptionGetLastError()));  
              if (
    zz>0
               { 
    OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 
    tepe OrderOpenPrice()-TP*Point*10esel=OrderOpenPrice()+SL*Point*10;
                 if (
    TP==0){ tepe=0;}
                 if (
    SL==0){ esel=0;}
                
                 
    OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                
    Alert(" modif TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"     "ErrorDescriptionGetLastError()));       
                }
            }    
     }
       
       
    //-------------------------------------------------------------- 

  9. The Following User Says Thank You to pengen-profit For This Useful Post:

    FXri (05-07-2012)

  10. #16
    Penggemar
    ----
     
    Gathot007 will become famous soon enough Gathot007 will become famous soon enough Gathot007's Avatar
    Join Date
    Jan 2012
    Location
    KampuS TradeR
    Posts
    293
    Accumulated bonus
    43 USD (What is this?)
    Thanks
    60
    Thanked 102 Times in 64 Posts
    Quote Originally Posted by FXri     
    pengen-profit,
    Gathot007,

    makasih Om...bentar ya saya coba dulu satu-satu

    update setelah dicoba :
    yang dari Om Pengen Profit sukses eksekusi buy dan sell di broker 4 digit dan 5 digit kalo TP dan SL di kasih 0 dan pake lot static, tapi kalo pake SL, TP, atau Lotnya dikasih 0.00 (pake MM) jadi eror.

    yang dari Om Gathot masih belum mau buka posisi Om.
    o rumusnya ngitung lotnya emang salah
    coba deh
    Spoiler Spoiler:
    PHP Code:
    //+------------------------------------------------------------------+
    //|                                                       Buy MM.mq4 |
    //|                                                          free    |
    //+------------------------------------------------------------------+
    #property copyright "Gathot_007"
    #include <stdlib.mqh>
    #property show_inputs

    extern bool MM=true;
    extern double MM_persen=2;
    extern double lots=0.01;
    extern bool  UseSL=true;
    extern double SL=20;
    extern bool UseTP=true;
    extern double TP=40;
    extern string NComment="buy_Gath";
    double LL,pn,margin;
    int ticket;
    //+------------------------------------------------------------------+
    //| script "transaksi untuk semua pairs"                                   |
    //+------------------------------------------------------------------+
    int start()
      {
    margin   MarketInfo(Symbol(), MODE_MARGINREQUIRED);
    if(
    MMLL=NR((MM_persen/100*AccountBalance())/margin); else LL=NR(lots);
       if(!
    UseSL &&!UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,0,0,"NComment",777,0,CLR_NONE);
       if( 
    UseSL && !UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,Ask-SL*pp(),0,"NComment",777,0,CLR_NONE);
       if(!
    UseSL && UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,0,Ask+TP*pp(),"NComment",777,0,CLR_NONE);
       if(
    UseSL && UseTP)ticket=OrderSend(Symbol(),0,LL,Ask,2,Ask-SL*pp(),Ask+TP*pp(),"NComment",777,0,CLR_NONE);
       if(
    ticket<1)
         {
          
    int error=GetLastError();
          Print(
    "Error = ",ErrorDescription(error));
          return;
         }
    //----
       
    OrderPrint();
       return(
    0);
      }
    double NR(double gath)
    {
        
    double maxlots MarketInfo(Symbol(), MODE_MAXLOT),
        
    minilot MarketInfo(Symbol(), MODE_MINLOT), 
        
    lstep MarketInfo(Symbol(), MODE_LOTSTEP);
        
    double lots lstep NormalizeDouble(gath lstep0);
        
    lots MathMax(MathMin(maxlotslots), minilot);
        return (
    lots);
    }
    double pp()
    {
    if(
    Digits==|| Digits==5pn=10*Point;else pn=Point;
    return(
    pn);


  11. The Following 2 Users Say Thank You to Gathot007 For This Useful Post:

    FXri (05-07-2012), sagakom (11-10-2013)

  12. #17
    Knuckle Gesit
    Lelah
     
    pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit's Avatar
    Join Date
    Aug 2011
    Location
    selalu di depan laptop
    Posts
    1,172
    Accumulated bonus
    232 USD (What is this?)
    Thanks
    147
    Thanked 975 Times in 486 Posts
    oh iya.. kalo pas di coba di 5 digit.. harga pada alert.. beda beda dikit sama hasilnya.. jangan heran ya.. karena 5 digit kan no requote.. jadinya pada harga berapapun akan di eksekusi..

    coba lagi ya.. kalo masih ada yang kurang laporan ..
    mumpung trading ane sudah clear posisi.. dan tangan lagi gatal nge JUNK

  13. The Following User Says Thank You to pengen-profit For This Useful Post:

    FXri (05-07-2012)

  14. #18
    Anggota
    Terinspirasi
     
    jokeprix is on a distinguished road jokeprix's Avatar
    Join Date
    Oct 2011
    Posts
    106
    Accumulated bonus
    113 USD (What is this?)
    Thanks
    5
    Thanked 14 Times in 13 Posts
    Quote Originally Posted by pengen-profit     
    wkwkwkkw.. iya.. sorry sorry.. coba lihat.. yang tadi.. dalam VOID NGESELL() nya.. perintahnya OP BUY semua.. wkwkwkwk
    makanya ane nyoba kok waktu SELL.. mesti error.. wkwkwkwk..

    yang ini di jamin deh..
    sudah ane tambahin refresh rates.. siapa tahu langsung pasang 2 arah.. biasanya kalo ga di kasih refresh rates.. habis pasang buy.. terus pas masang sell nya harga sudah keburu berubah.. jadinya error INVALID PRICE

    PHP Code:
    //+------------------------------------------------------------------+
    //|                                              belum ada judul.mq4 |
    //|                                                    Pengen Profit |
    //|                                                                  |
    //+------------------------------------------------------------------+
    #property copyright "Pengen Profit"
    #property link      ""
    #property show_inputs
    #include <stderror.mqh>
    #include <stdlib.mqh> 
    //+------------------------------------------------------------------+
    //| script program start function                                    |
    //+------------------------------------------------------------------+

    //----//parameternya ini, input-nya ini
    extern double Persen_Margin=5;
    extern bool buy=false;
    extern bool sell=false;
    extern int TP=0;  //  boleh di isi angka.. boleh nol.. bebas...
    extern int SL=0;
    extern int slippage=3;
    extern string LotStatic"jika di isi 0 maka pake MM";
    extern double Lotstatic=0;
    extern string comen=" apa ya??? ";
    extern int magic7455458438884855;
    int digit;
    double LotminlotmaxlotlotstepmarginLOT;                


    //(c)2010 eninefx
    int start()
      {  
    //int dg=1;
      //if (Digits==3 || Digits==5){ dg=10;}
      
       
    margin   MarketInfo(Symbol(), MODE_MARGINREQUIRED);
       
    minlot   MarketInfo(Symbol(), MODE_MINLOT);
       
    maxlot   MarketInfo(Symbol(), MODE_MAXLOT);
       
    lotstep  MarketInfo(Symbol(), MODE_LOTSTEP);
       
    double tickMarketInfo(Symbol(), MODE_TICKVALUE);
       if(
    lotstep==0.1)  digit=1;
       if(
    lotstep==0.01)  digit=2;
       if(
    lotstep==0.001)  digit=3;
       
       
    Lot NormalizeDouble( ( (Persen_Margin/100*AccountBalance())/margin)/tickdigit);
       
       if (
    Lot<minlot){ Lot=minlot;}
       if (
    Lot>maxlot){ Lot=maxlot;}
      
       if (
    Lotstatic==0){ LOT Lot;}
       if (
    Lotstatic!=0){ LOT Lotstatic;}
        
    Alert" LOT = "DoubleToStr(LOT,2));
       if (
    buy){ ngebuy();}
       if (
    sell) { ngesell();}
     
       return(
    0);
      }
      
    //--------------------------------------------------------  
      
      
    void ngebuy()
     {    
    RefreshRates();
         if (
    Digits==2||Digits==4
           { 
    double tepe Ask+TP*Pointesel=Ask-SL*Point;
            if (
    TP==0){ tepe=0;}
            if (
    SL==0){ esel=0;}
            
    OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage,esel,tepe,comen,magic,0);
           
    Alert(" buy @ = "+DoubleToStr(Ask,Digits)+" TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"     "ErrorDescriptionGetLastError()));  
            }
         if (
    Digits==3||Digits==5)
             {  
             
             
    int zz OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage*10,0,0,comen,magic,0);
             
    Alert(" buy  @ "+DoubleToStr(Ask,Digits)+"    "ErrorDescriptionGetLastError()));  
              if (
    zz>0
               { 
    OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 
    tepe OrderOpenPrice()+TP*Point*10esel=OrderOpenPrice()-SL*Point*10;
                 if (
    TP==0){ tepe=0;}
                 if (
    SL==0){ esel=0;}
                
                 
    OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                 
    Alert(" modif TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"     "ErrorDescriptionGetLastError()));       
               }
            }    
     }
             
    //--------------------------------------         
      
    void ngesell()
     {    
    RefreshRates();
          if (
    Digits==2||Digits==4
           { 
    double tepe Bid-TP*Pointesel=Bid+SL*Point;
            if (
    TP==0){ tepe=0;}
            if (
    SL==0){ esel=0;}
            
    OrderSend(Symbol(),OP_SELL,LOT,Bid,slippage,esel,tepe,comen,magic,0); 
            
    Alert(" sell @ = "+DoubleToStr(Bid,Digits)+" TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"    "ErrorDescriptionGetLastError()));  
           }
        if (
    Digits==3||Digits==5)
             {  
             
             
    int zz OrderSend(Symbol(),OP_SELL,LOT,Bid,slippage*10,0,0,comen,magic,0);
             
    Alert(" sell  @ "+DoubleToStr(Bid,Digits)+"    "ErrorDescriptionGetLastError()));  
              if (
    zz>0
               { 
    OrderSelect(OrdersTotal()-1,SELECT_BY_POS,MODE_TRADES);
                 
    tepe OrderOpenPrice()-TP*Point*10esel=OrderOpenPrice()+SL*Point*10;
                 if (
    TP==0){ tepe=0;}
                 if (
    SL==0){ esel=0;}
                
                 
    OrderModify(OrderTicket(),OrderOpenPrice(),esel,tepe,OrderExpiration(),CLR_NONE);    
                
    Alert(" modif TP= "+DoubleToStr(tepe,Digits)+" SL="+DoubleToStr(esel,Digits)+"     "ErrorDescriptionGetLastError()));       
                }
            }    
     }
       
       
    //-------------------------------------------------------------- 
    apa yang ini sudah bener bener fix gan?
    kog ane lihat dari atas, di benerin mulu
    hehe pissssss dah
    soalnya saya minat juga nih kayaknya

  15. #19
    Knuckle Gesit
    Lelah
     
    pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit is a splendid one to behold pengen-profit's Avatar
    Join Date
    Aug 2011
    Location
    selalu di depan laptop
    Posts
    1,172
    Accumulated bonus
    232 USD (What is this?)
    Thanks
    147
    Thanked 975 Times in 486 Posts
    yeee.. seorang coder juga manusia.. wkwkwkw

    kalo ga ada orang lain yang ngoreksi juga kadang ga ketahuan Gan errornya dimana..

    Ente aja sendiri kalo pake baju.. kerahnya ga bener kan juga ga tahu..kalo ga ada orang lain yang ngelihat.. dan kasih tahu.. betul ga?

  16. #20
    Anggota
    Terinspirasi
     
    jokeprix is on a distinguished road jokeprix's Avatar
    Join Date
    Oct 2011
    Posts
    106
    Accumulated bonus
    113 USD (What is this?)
    Thanks
    5
    Thanked 14 Times in 13 Posts
    Quote Originally Posted by pengen-profit     
    yeee.. seorang coder juga manusia.. wkwkwkw

    kalo ga ada orang lain yang ngoreksi juga kadang ga ketahuan Gan errornya dimana..

    Ente aja sendiri kalo pake baju.. kerahnya ga bener kan juga ga tahu..kalo ga ada orang lain yang ngelihat.. dan kasih tahu.. betul ga?
    wkwkwkwkwk
    seepp gan, bener banget tuh
    sebelumnya saya belum pernah pasang script gan
    klo pasang EA n indikator masih bisa
    kalo script naruhnya dimana y?

Page 2 of 4
FirstFirst 1 2 3 4 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