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 Pembagian Kelas Kursus MQL dari Nol sampai mahir

Discussion in 'Belajar MQL dari Nol' started by SoeHoe, 24 Sep 2021.

Tags:
  1. SoeHoe

    SoeHoe Administrator Moderator

    Equity
    Credit
    Ref Point
    Selamat datang di kursus MQL dari Nol sampai mahir
     
  2. SoeHoe

    SoeHoe Administrator Moderator

    Equity
    Credit
    Ref Point
    Code:
    void QnReadObj(){
       for(int i=0; i<ObjectsTotal(); i++){
          string objName = ObjectName(chart_ID,i,0,0);
          if(ObjectType(objName)!=OBJ_RECTANGLE) continue;
          double price = ObjectGetDouble(chart_ID,objName,OBJPROP_PRICE1);
          //
         
       }
       
    }
     
  3. Indra Dharmawan

    Indra Dharmawan New Member

    Equity
    Credit
    Ref Point
    5/5,
    This is my review for this thread:
    GOOD
     
  4. xpandFX

    xpandFX New Member

    Equity
    Credit
    Ref Point
    First post pak... ijin belajar pak. Saya mulai paud saja. Tahunya baru website building cms wordpress saja pak.
     
  5. yohanes listiyono

    yohanes listiyono New Member

    Equity
    Credit
    Ref Point
    hadir saja pak, sy murid TK gak tahu pemrograman paling banter excel aja pak..
     
  6. edu akbar

    edu akbar New Member

    Equity
    Credit
    Ref Point
    Code:
    int OnInit()
      {
    //---
       
       int    MinTakeProfit = 500;
       int    MaxStopLoss   = 200;
       double Lot           = 0.5;
       string notes         = "EA Profit";
       
       Alert("Coba Belajar MQL");
       
       
       
    //---
       return(INIT_SUCCEEDED);
      }
     
  7. Indra Dharmawan

    Indra Dharmawan New Member

    Equity
    Credit
    Ref Point
    ini sudah saya insert Code.

    Code:
    void QnSignalTrend(){
       //double result();
       int result=0;
       int counter = 0;
       int ticket = 0;
     
       int iTF = PERIOD_M30;//Period(); //M1
     
     
       double minstoplevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
       Alert("Minimum Stop Level=",minstoplevel," points");
       //double price=Ask;
    //--- calculated SL and TP prices must be normalized
       double stoploss=NormalizeDouble(Bid-minstoplevel*Point,Digits);
       double takeprofit=NormalizeDouble(Bid+minstoplevel*Point,Digits);
        Alert("TP=",takeprofit," points");
       if(profit()>5){      CloseOrders();   }
     
       //signal BUY jika p0>p1>p2
       //signal SELL jika p0<p1<p2
       //signal CLOSE jika p1>p2 dan p0<p1
       //signal CLOSE jika p1<p2 dan p0>p1
       //signal pertama BUY jika tidak ada OP dan p0>p1
       //signal pertama SELL jika tidak ada OP dan p0<p1
     
       double tpBUY = Ask+iTP;
       double tpSELL = Bid-iTP;
       double tpBUY2 = Ask+iTP;
       double tpSELL2 = Bid-iTP;
     
       if(OrdersTotal()==0 && pTrend0>pTrend1){
          //buy
         Alert("First BUY :"+(string)pTrend0+";"+(string)pTrend1+";"+(string)pTrend2); 
          ticket=OrderSend(NULL,OP_BUY,diLots,Ask,3,0,tpBUY,sComment,16384,0,clrBlueViolet);   
         // ticket=OrderSend(NULL,OP_SELL,diLots*2,Bid,3,0,tpSELL2,sComment,16384,0,clrRed);   
         
       }else if(OrdersTotal()==0 && pTrend0<pTrend1){
       Alert("First SELL :"+(string)pTrend0+";"+(string)pTrend1+";"+(string)pTrend2); 
          ticket=OrderSend(NULL,OP_SELL,diLots,Bid,3,0,tpSELL,sComment,16384,0,clrRed);
          //ticket=OrderSend(NULL,OP_BUY,diLots*2,Ask,3,0,tpBUY2,sComment,16384,0,clrBlueViolet);   
       
       }else {
                if(pTrend0>pTrend1 && pTrend1>pTrend2){
                   //buy
                   Alert("BUY :"+(string)pTrend0+";"+(string)pTrend1+";"+(string)pTrend2); 
                   if(QnCekOPSELL()>0){
                      Alert("Close All Sell "+(string)QnCekOPSELL());
                      dLots = diLots*firstLots;
                     // CloseOrders();               
                   } 
                   if(OrdersTotal()<iLimitOrders){       
                      ticket=OrderSend(NULL,OP_BUY,diLots,Ask,3,0,tpBUY,sComment,16384,0,clrBlueViolet);
                     // ticket=OrderSend(NULL,OP_SELL,diLots*2,Bid,3,0,tpSELL2,sComment,16384,0,clrRed);
                         dLots =diLots;
                   }
                   
                }else if(pTrend0<pTrend1 && pTrend1<pTrend2){
                   //sell
                   Alert("SELL :"+(string)pTrend0+";"+(string)pTrend1+";"+(string)pTrend2); 
                   if(QnCekOPBUY()>0){
                      Alert("Close All Buy "+(string)QnCekOPBUY());
                      dLots = diLots*firstLots;
                      //CloseOrders();
                   }
                   if(OrdersTotal()<iLimitOrders){ 
                      ticket=OrderSend(NULL,OP_SELL,diLots,Bid,3,0,tpSELL,sComment,16384,0,clrRed);
                      //ticket=OrderSend(NULL,OP_BUY,diLots*2,Ask,3,0,tpBUY2,sComment,16384,0,clrBlueViolet); 
                         dLots =diLots;
                      }
                }
             /*else if((pTrend0<pTrend1 && pTrend1>pTrend2) || (pTrend0>pTrend1 && pTrend1<pTrend2)){
                //close all
                Alert("close all");
                CloseOrders();
                }*/
          }
     
     
     
       if(ticket<0)
         {
          Print("OrderSend failed with error #",GetLastError());
         }
       else
          Print("OrderSend placed successfully");
       /*
       for(int i=0; i<1 ; i++){
          double pTrend = QnTrend(i);
          if(pTrend>0){
             counter++;
             Alert(pTrend);
          }
          if(i==30){
             break;
          }
       }
       */
       if(iVolume(NULL,iTF,0)>1) return;
       pTrend0 = QnTrend(0);
       pTrend1 = QnTrend(1);
       pTrend2 = QnTrend(2);
     
    //return(result);
    }
     
    Last edited: 24 Sep 2021
  8. xpandFX

    xpandFX New Member

    Equity
    Credit
    Ref Point
    5/5,
    This is my review for this thread:
    Good
     
  9. gustidharma

    gustidharma New Member

    Equity
    Credit
    Ref Point
    Saya dari kelas TK aja,
     
  10. david.ys

    david.ys New Member

    Equity
    Credit
    Ref Point
     
  11. Bima Danang Wijaya

    Bima Danang Wijaya New Member

    Equity
    Credit
    Ref Point
    saya nggak tau apa apa soal coding pak...dan saya bener bener nol 0
     
  12. sangkakala

    sangkakala New Member

    Equity
    Credit
    Ref Point
    Mantap lagi ikut zoom juga nie
     
  13. wisnu58

    wisnu58 New Member

    Equity
    Credit
    Ref Point
    Cek
     
  14. Arwan

    Arwan New Member

    Equity
    Credit
    Ref Point
  15. Slamet Hariyadi

    Slamet Hariyadi New Member

    Equity
    Credit
    Ref Point
    ini fungsi looping ya, cuman yang saya gak ngerti perintah ini suhu
    if(ObjectType(objName) mksdx seperti apa?
    karna selama ini saya bikin ea biasa cmn gak seperti ini.
    sebelumnya saya sdh kursus bikin ea cmn ingin mendalami ke yang lebih lanjut.
    sdh ada beberapa EA sederhana seperti marti, averaging dan single op sdh saya buat cmn masih level sederhana pak.
     
    Last edited: 24 Sep 2021
  16. matvei

    matvei New Member

    Equity
    Credit
    Ref Point
    Code:
    void createRect(string name_,int width_=100,int height_=100,int corner_=CORNER_RIGHT_UPPER,color bgCol_=clrDarkSlateGray,color borderCol_=clrDarkSlateGray,int x_=0,int y_=0,ENUM_OBJECT type_=OBJ_RECTANGLE)
      {
       if(ObjectFind(name_)!=0)
         {
          ObjectCreate(0,name_,OBJ_RECTANGLE_LABEL,0,0,0);
         }
       ObjectSetInteger(0,name_,OBJPROP_BGCOLOR,bgCol_);
       ObjectSetInteger(0,name_,OBJPROP_BORDER_TYPE,BORDER_FLAT);
       ObjectSetInteger(0,name_,OBJPROP_BORDER_COLOR,borderCol_);
       ObjectSetInteger(0,name_,OBJPROP_COLOR,borderCol_);
       ObjectSetInteger(0,name_,OBJPROP_XSIZE,width_);
       ObjectSetInteger(0,name_,OBJPROP_YSIZE,height_);
       ObjectSetInteger(0,name_,OBJPROP_SELECTABLE,0);
       ObjectSetInteger(0,name_,OBJPROP_CORNER,corner_);
       ObjectSetInteger(0,name_,OBJPROP_HIDDEN,1);
       ObjectSetInteger(0,name_,OBJPROP_YDISTANCE,y_);
       ObjectSetInteger(0,name_,OBJPROP_XDISTANCE,x_);
      }
     
  17. Rafael Benny

    Rafael Benny New Member

    Equity
    Credit
    Ref Point
    -
     
    Last edited: 24 Sep 2021
  18. gustidharma

    gustidharma New Member

    Equity
    Credit
    Ref Point
    Saya mau belajar dr kelas TK dulu, cuma mengerti kalau pakai exel, semua belajar otodidak
     
  19. irsyad kamil

    irsyad kamil New Member

    Equity
    Credit
    Ref Point
    selamat siang pak,, ini saya coba postkan sidikit yang saya pelajari dari pelajaran 1-3 sebelumnya,

    Code:
     ObjectsDeleteAll();
       EventSetMillisecondTimer(100);
       pairName = QnPair(_Symbol); //EURUSDmicro
       if(pairName=="") {
          Alert("Pair: ",_Symbol," is not listed in ListPairs");
          return(INIT_FAILED);
     
  20. gtnkomp

    gtnkomp New Member

    Equity
    Credit
    Ref Point
    saya baru paham sampai sini, utk bahasa pemrograman saya hanya tau sedikit php dan html
     
    Last edited: 24 Sep 2021

Share This Page