Reply to Thread
Page 11 of 11
FirstFirst ... 9 10 11
Results 101 to 102 of 102

Thread: Belajar coding dasar with inLuk

  1. #101
    Penggemar
    Terinspirasi
     
    inLuk is on a distinguished road inLuk's Avatar
    Join Date
    Apr 2017
    Posts
    223
    Accumulated bonus
    98.25 USD (What is this?)
    Saya bertemu tamu
    1 (detail lebih lanjut)
    Thanks
    0
    Thanked 46 Times in 36 Posts
    Quote Originally Posted by Anti Gengsi View Post
    PHP Code:
    input int JmlEA=4;//JumlahEA
    // pengisian magic number EA yang terpakai 
    // mulai dari atas
    // mis jumlah EA hanya 2
    // HARUS diinputkan pada MagicNumberEA1 dan MagicNumberEA2
    // Tidak boleh MagicNumberEA2 dan MagicNumberEA3 
    input int MgcNbr1=1111;//MagicNumberEA1
    input int MgcNbr2=1112;//MagicNumberEA2
    input int MgcNbr3=1113;//MagicNumberEA3
    input int MgcNbr4=1114;//MagicNumberEA4

    void OnTick()
      {
     
         
    int MgcNumber[4],mm,xx,yy,zz;
         
    double profprof[4],a,b,c;
         
    ArrayInitialize(profprof,0);
         
    MgcNumber[0]=MgcNbr1;
         
    MgcNumber[1]=MgcNbr2;
         
    MgcNumber[2]=MgcNbr3;
         
    MgcNumber[3]=MgcNbr4;
        for(
    mm=0;mm<JmlEA;mm++)
        { 
         
    CekOpening(MgcNumber[mm]);
         
    profprof[mm]=profB+profS;
        }

          
    a=0
          for(
    xx=0;xx<JmlEA;xx++)
           {
             
    a=profprof[xx];
             
    b=0;c=0;
             if(
    xx+1<JmlEA)
              {
                for(
    yy=xx+1;yy<JmlEA;yy++)
                 {
                   
    b=profprof[yy];
                   
    c=0;
                   if(
    yy+1<JmlEA)
                    {
                     for(
    zz=yy+1;zz<JmlEA;zz++)
                      {
                        
    c=profprof[zz];
                        if(
    a+b+c>AccountMargin())
                         {

                             
    Closeddd(MgcNumber[xx]);

                             
    Closeddd(MgcNumber[yy]);

                             
    Closeddd(MgcNumber[zz]);

                         }
                      }
                    } 
                    else
                    {
                        if(
    a+b>AccountMargin())
                         {

                             
    Closeddd(MgcNumber[xx]);

                             
    Closeddd(MgcNumber[yy]);

                        }                                           
                    } 
                 } 
               }  
            }
           

      }
    }

    void CekOpening(int toktok)
    {
      
    int Total=OrdersTotal(),cnt;
      
    byS=0;sleS=0;profB=0;profS=0;

      for(
    cnt=0;cnt<Total;cnt++)
      {
          if(!
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
             continue;
           if(
    OrderMagicNumber()==toktok)
            {
             
    //--- long position is opened
             
    if(OrderType()==OP_BUY)
               {
                 
    byS++;
                 
    profB=profB+OrderProfit()+OrderCommission()+OrderSwap();
               }
             if(
    OrderType()==OP_SELL)
               {
                 
    sleS++;
                 
    profS=profS+OrderProfit()+OrderCommission()+OrderSwap();
               }
            }
       }    

         
    }

      
    bool Closeddd(int tiktik)
     {
       
    int Total=OrdersTotal(),cnt;
      
    byS=0;sleS=0;

      for(
    cnt=0;cnt<Total;cnt++)
      {
          if(!
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
             continue;
            if(
    OrderMagicNumber()==tiktik)
            {

                if (
    OrderType()==OP_BUY)
                  {
                     if(!
    OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet))
                      {Print(
    "OrderClose error ",GetLastError());}
                     else {return(
    true);}  
                  }
                if (
    OrderType()==OP_SELL)
                  {
                     if(!
    OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet))
                       {Print(
    "OrderClose error ",GetLastError());}
                     else {return(
    true);}  
                  }         
             }

       }    
        return(
    false);
     } 
    ini om baru di buatin juga sama om wanyok tapi trouble di close error 129 ( tab expert)
    besok saya kasih script nya.. order delete error kemungkinan terjadi kalo coder ga melakukan filtrasi terhadap entry yg d close
    -- EA developer @inLuk--

  2. <a href="https://www.ifxid.com/id/company_news">Forex Portal MT5</a>
  3. #102
    Pecandu
    ----
     
    Anti Gengsi will become famous soon enough Anti Gengsi's Avatar
    Join Date
    Dec 2016
    Posts
    426
    Accumulated bonus
    121.85 USD (What is this?)
    Saya bertemu tamu
    5 (detail lebih lanjut)
    Thanks
    124
    Thanked 74 Times in 68 Posts
    Quote Originally Posted by inLuk View Post
    besok saya kasih script nya.. order delete error kemungkinan terjadi kalo coder ga melakukan filtrasi terhadap entry yg d close
    iya om klo masalah magic banyak di satu file belum paham/bisa di bilang gak ngerti sama sekali
    maklum om masih nubie/coder kuning full warning saya sekalian belajar sama master2.
    Plan is Simple but Proses is The ruwed ll Virza motto"kita tetap slow aja,Enjoy Your Life"

Reply to Thread
Page 11 of 11
FirstFirst ... 9 10 11

Posting Permissions

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