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 122 of 122
FirstFirst ... 22 72 112 120 121 122
Results 1,211 to 1,219 of 1219

Thread: Tanya Jawab Seputar Coding MQL

  1. #1211
    Anggota
    Bahagia
     
    CMH has a spectacular aura about CMH has a spectacular aura about CMH's Avatar
    Join Date
    Dec 2018
    Posts
    182
    Accumulated bonus
    23 USD (What is this?)
    Thanks
    32
    Thanked 161 Times in 64 Posts
    Quote Originally Posted by amtwoxtwo View Post
    G paham maksudnya



    Bikin Pengenal order dulu
    Code:
    int OPBuy=0, OPBS=0, OPBL=0, OPSell =0, OPSL=0, OPSS=0;
    //-------------------------
    for (int a = 0; a < OrdersTotal(); a++)
       { 
          if(OrderSelect(a, SELECT_BY_POS,MODE_TRADES) == true)
          { 
             if (OrderSymbol() == Symbol() && OrderCloseTime() == 0) 
             {
                   if(OrderType() == OP_BUY)  OPBuy++; 
                   if(OrderType() == OP_BUYSTOP) OPBS++;
                   if(OrderType() == OP_BUYLIMIT) OPBL++;
                   if(OrderType() == OP_SELL) OPBSell++;
                   if(OrderType() == OP_SELLSTOP) OPSS++;
                   if(OrderType() == OP_SELLLIMIT) OPSL++;
              }
          } 
       }
    lalu fungsi if untuk menutup jika kondisi order=0 dan pending>0
    Code:
    if(OPBuy==0||OPSELL==0)
    {if(OPBS>0||OPBL>0||OPSS>0||OPSS>0)
    OrderDelete();
    }
    wah, bagus banget ya kalau menguasai coding.
    Saya beneran penasaran mau bikin coding sendiri untuk ea sendiri.
    Tapi spertinya harus belajar lama. Karena harus belajar dari 0 lagi.

    Postingannya inspiratif banget. Saya suka.
    $$$ SALAM PROFIT $$$

  2. <a href="">Forex Portal MT5</a>
  3. #1212
    Orang Asing
    ----
     
    LuckyAbby is an unknown quantity at this point LuckyAbby's Avatar
    Join Date
    Jan 2019
    Posts
    1
    Accumulated bonus
    0 USD (What is this?)
    Thanks
    1
    Thanked 0 Times in 0 Posts
    kalau buy= Ask - (Ask-Bid)


    bukannya sama dengan ---> buy=Ask - spread ---> buy = Bid

  4. #1213
    Orang Lama
    Semilir
     
    amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo's Avatar
    Join Date
    Sep 2010
    Location
    Sekitaran Bumi
    Posts
    1,014
    Accumulated bonus
    133 USD (What is this?)
    Thanks
    96
    Thanked 563 Times in 294 Posts
    Quote Originally Posted by LuckyAbby View Post
    kalau buy= Ask - (Ask-Bid)


    bukannya sama dengan ---> buy=Ask - spread ---> buy = Bid
    sama. karena spread = ask-bid
    untuk cek spread
    Code:
    double spread = NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD),0);
    Yahuuu

  5. #1214
    Pecandu
    ----
     
    anakmami is a splendid one to behold anakmami is a splendid one to behold anakmami is a splendid one to behold anakmami is a splendid one to behold anakmami is a splendid one to behold anakmami is a splendid one to behold anakmami is a splendid one to behold anakmami is a splendid one to behold anakmami's Avatar
    Join Date
    Jan 2019
    Posts
    673
    Accumulated bonus
    250 USD (What is this?)
    Thanks
    52
    Thanked 1,195 Times in 478 Posts
    Quote Originally Posted by amtwoxtwo View Post
    sama. karena spread = ask-bid
    untuk cek spread
    Code:
    double spread = NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD),0);
    saya punya ea, mau saya edit untuk peraturan close/SL nya, apakah bisa bantu? ini ea close berdasarkan candle break dan di berbagai time frame, mau di ubah dalam hitungan pips saja untuk SL nya..

    Code:
    //+------------------------------------------------------------------+
    //|                                                EA FIBO X v3.mq4 |
    //|                                                    Ahmad Habibi |
    //|                                                    Ahmad Habibi |
    //+------------------------------------------------------------------+
    #property copyright "Ahmad Habibi"
    #property link      "Ahmad Habibi"
    #property version   "1.00"
    #property strict
    //+------------------------------------------------------------------+
    //| Expert initialization function                                   |
    //+------------------------------------------------------------------+
    
    datetime Expired      = D'30.12.2025'; // Ganti tanggal expired disini (Hari-Bulan-Tahun)
    
    string NamaEA="EA FIBO X";
    extern string   Owner1       = "===== Copyright ©2018 by Ahmad Habibi =====";//=====================================
    input  double   LotsX        = 0.01;    // Lots PO Konfirmasi
    input  double   Lots1        = 0.01;   // Lots Level 1
    input  double   Lots2        = 0.02;   // Lots Level 2
    input  double   Lots3        = 0.03;   // Lots Level 3
    input  double   Lots4        = 0.04;   // Lots Level 4
    input  double   Lots5        = 0.05;   // Lots Level 5
    input  string   Ct_          = "-----< Level Fibo >-----"; //=====================================
    input  double   Bs           = 127.2;   // Buy Stop
    input  double    TPb         = 200;     // TP Buy
    input  double   KSb          = 70;      // Konfirmasi Buy Stop
    input  double   Ss           = -27.2;   // Sell Stop
    input  double   TPs          = -100;    // TP Sell
    input  double   KSs          = 30;      // Konfirmasi Sell Stop
    input  ENUM_TIMEFRAMES TF    = 5;       // Close Timeframe
    input  string   Box_         = "-----< Setting Fibo >-----";//=====================================
    input  int      Start        = 9;      // Start candle
    input  int      End          = 10;     // End candle
    input  int      MinBox       = 1;      // Min Range HiLo (Pip)
    input  int      MAxBox       = 60;     // Max Range HiLo(Pip)
    input  string   Other_       = "-----< Other >-----"; //=====================================
    input  int      Magic        = 123;  // MagicNumber
    input  string   comment      = "EA FIBO X"; // Comment
    input  bool     Display      = true; // Display
    
    color    warnabox     = clrGray;//Warna Box
    int      Slippage     = 10;   // Max Slippage
    
    string COLORS = "==< COLOR >==";
    color  BoxColor      = clrBlue;
    color  RangeColor    = clrYellow;
    color  TPBuyColor    = clrAqua;
    color  TPSellColor   = clrDeepPink;
    color  CandleUpColor = clrLime;
    color  CandleDnColor = clrWhite;
    color  PercentColor  = clrWhite;
    
    int    TextSize          = 8; 
    int    AdjustArrowUp     = 8; 
    int    AdjustArrowDown   = 8; 
    
    
    int count,xx=0,i=0,tb=0,ts=0;
    double hi,lo;
    double TPbuy1,TPbuy2,TPbuy3,TPsell1,TPsell2,TPsell3;
    double theRange;
    int CandleHour;
    
    
    color timeColor = clrGold;
    //---- buffers
    color  warnatxt = clrAqua;// Warna Text
    ENUM_BASE_CORNER Info_Corner = 0;
    ulong muc,muc1;
    string ac,sec;
    double s1[];
    datetime t1;
    bool ab1,ab2,ab3,as1,as2,as3,bb,bs;
    double pt,SetPoint;
    int I,en;
    int gagalpobuy=4;
    int gagalposell=3;
    datetime timeStart;
    datetime st1;
    int shift,cnt=0;
    datetime tm1,tm2;
    int Warna;
    int turun        = 0;
    double minlot=0,maxlot=0;
    double xbawah=0,xatas=0;
    double lotv=0,Lots=0;
    int LEVEL=0;
    string totTP="",totSL="";
    int OnInit()
      {
    //---
       if (Digits == 3 || Digits == 5){SetPoint =10*Point;}
       if (Digits == 2 || Digits == 4){SetPoint = Point;}
       
       
       ChartSetInteger(0,CHART_SHOW_GRID,0,FALSE);      
       ChartSetInteger(0,CHART_SHOW_PERIOD_SEP,0,TRUE);
       ChartSetInteger(0,CHART_MODE,TRUE);
       ChartSetInteger(0,CHART_COLOR_CHART_UP,clrLime); 
       ChartSetInteger(0,CHART_COLOR_CANDLE_BULL,clrLime);    
       ChartSetInteger(0,CHART_COLOR_CHART_DOWN,clrRed); 
       ChartSetInteger(0,CHART_COLOR_CANDLE_BEAR,clrRed);    
       
        minlot=MarketInfo(Symbol(),MODE_MINLOT);
        maxlot=MarketInfo(Symbol(),MODE_MAXLOT);
        
        
       ObjectsDeleteAll();
       start();
    //---
       return(INIT_SUCCEEDED);
      }
    //+------------------------------------------------------------------+
    //| Expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
      {
    //---
       
      }
    //+------------------------------------------------------------------+
    //| Expert tick function                                             |
    //+------------------------------------------------------------------+
    int start()
      {
    //---
    if (TimeCurrent() > Expired) {Comment("EXPIRED");return(0);}
    
    //EA================================================================================================================================
       int  TO=0,TB=0,TS=0,SS=0,BS=0;
       double PRB=0,PRS=0,LTB=0,LTS=0,prices=0,priceb=0,ltb=0,lts=0;datetime tmb=0,tml=0;string cms="";
       for (i=0;i<OrdersTotal();i++){
       xx=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
          if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1))
            {TB++;TO++;PRB=PRB+OrderProfit()+OrderCommission()+OrderSwap();LTB+=OrderLots();priceb=OrderOpenPrice();ltb=OrderLots();tmb=OrderOpenTime();}
          if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1))
            {TS++;TO++;PRS=PRS+OrderProfit()+OrderCommission()+OrderSwap();LTS+=OrderLots();prices=OrderOpenPrice();lts=OrderLots();tmb=OrderOpenTime();}
          if(OrderType()==OP_BUYSTOP && OrderSymbol()==Symbol()  && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1)){BS++;}
          if(OrderType()==OP_SELLSTOP && OrderSymbol()==Symbol() && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1)){SS++;}  
           }
          
          if(TB==1 && GetLine("KSb")>0 && BS==0 && Bid<GetLine("KSb")){
             xx=OrderSend(Symbol(),OP_BUYSTOP,LotsX,priceb,Slippage,0,0,comment+" ~ Konfir  ",Magic+1,0,clrGreen);
          }
          if(TS==1 && GetLine("KSs")>0 && SS==0 && Bid>GetLine("KSs")){
             xx=OrderSend(Symbol(),OP_SELLSTOP,LotsX,prices,Slippage,0,0,comment+" ~ Konfir  ",Magic+1,0,clrGold);
          }
    
             datetime today = iTime(Symbol(),1440,0);
             string jam1 = TimeToStr(today,TIME_DATE)+" "+IntegerToString(Start)+":00";
             string jam2 = TimeToStr(today,TIME_DATE)+" "+IntegerToString(End)+":00";
             if(Start<10){jam1 = TimeToStr(today,TIME_DATE)+" 0"+IntegerToString(Start)+":00";}
             if(End<10){jam2 = TimeToStr(today,TIME_DATE)+" 0"+IntegerToString(End)+":00";}
             
             double Up=ObjectGet("GHBox", OBJPROP_PRICE1);
             double Lo=ObjectGet("GHBox", OBJPROP_PRICE2);
             datetime tm=(datetime)ObjectGet("GHBox", OBJPROP_TIME2);
          
             if(TimeCurrent()>StrToTime(jam2) && TimeCurrent()-20*60<StrToTime(jam2) && TimeDay(tm)!=Day() && TO==0){
             xbawah=0;xatas=0;
             /*
             int jum=(End-Start);
             int val_index=iHighest(NULL,PERIOD_H1,MODE_HIGH,jum,1);
             if (val_index!=-1) xatas=High[val_index]; 
             
             int val_index2=iLowest(NULL,PERIOD_H1,MODE_LOW,jum,1);
             if (val_index2!=-1) xbawah=Low[val_index2];
             */
             for(i=0;i<200;i++){
                if(Time[i]<StrToTime(jam2) && Time[i]>=StrToTime(jam1)){
                   if(xbawah==0){xbawah=Low[i];}
                   if(xbawah>Low[i]){xbawah=Low[i];}
                   if(xatas==0){xatas=High[i];}
                   if(xatas<High[i]){xatas=High[i];}
                }
                if(Time[i]<StrToTime(jam1)){break;}
             }
             
             
             if(xatas>0 && xatas-xbawah>MinBox*SetPoint && xatas-xbawah<MAxBox*SetPoint){
             ivar031 ("GHBox",StrToTime(jam1),xatas,StrToTime(jam2),xbawah,warnabox,1, STYLE_SOLID, true);
             }
            }
             
             if(xatas-xbawah<MinBox*SetPoint && TO==0  && TimeCurrent()>StrToTime(jam2)){info("Tidak order Range HiLo kecil");}
             else if(xatas-xbawah>MAxBox*SetPoint && TO==0  && TimeCurrent()>StrToTime(jam2)){info("Tidak order Range HiLo Besar");}
             else{ObjectDelete("M1");}
    
       double UP=ObjectGet("GHBox", OBJPROP_PRICE1);
       double LO=ObjectGet("GHBox", OBJPROP_PRICE2);
       Comment("UP ",UP,"\nLO ",LO,"\n",HS());
    
    if(UP>0 && LO>0 && TO==0 && BS==0 && !HS()){
       double BB  =(UP-LO)/100;
       double rg  =NormalizeDouble(LO+(Bs*BB),Digits);
       
       double tpb=NormalizeDouble(LO+(TPb*BB),Digits);
       SetLine("TPb",NormalizeDouble(tpb,Digits));
       SetLine("KSb",NormalizeDouble(LO+(KSb*BB),Digits));
       lv();
       xx=OrderSend(Symbol(),OP_BUYSTOP,Lots,rg,Slippage,0,0,comment+" ~ Level  "+IntegerToString(LEVEL),Magic,0,clrGreen);
    }
    
    if(UP>0 && LO>0 && TO==0 && SS==0 && !HS()){
       double BB  =(UP-LO)/100;
       double rgs  =LO;
       if(Ss>0){rgs  =NormalizeDouble(LO+(Ss*BB),Digits);}
       if(Ss<0){double rgX=0;rgX-=Ss;
       rgs  =NormalizeDouble(LO-(rgX*BB),Digits);}
       
       double tps  =LO;
       if(TPs>0){tps  =NormalizeDouble(LO+(TPs*BB),Digits);}
       if(TPs<0){double tpX=0;tpX-=TPs;
       tps  =NormalizeDouble(LO-(tpX*BB),Digits);}
       SetLine("KSs",NormalizeDouble(LO+(KSs*BB),Digits));
       SetLine("TPs",NormalizeDouble(tps,Digits));
       lv();
       xx=OrderSend(Symbol(),OP_SELLSTOP,Lots,rgs,Slippage,0,0,comment+" ~ Level  "+IntegerToString(LEVEL),Magic,0,clrGold);
    }
    
    if(TB>0 && tmb<iTime(NULL,TF,1) && iClose(NULL,TF,1)<LO && LO>0 && iClose(NULL,TF,1)>0){closeOP(4);closeOP(0);ObjectDelete("KSb");ObjectDelete("TPb");}
    if(TS>0 && tmb<iTime(NULL,TF,1) && iClose(NULL,TF,1)>UP && UP>0 && iClose(NULL,TF,1)>0){closeOP(5);closeOP(1);ObjectDelete("KSs");ObjectDelete("TPs");}
    
    if(TB>0 && GetLine("TPb")>0 && Bid>GetLine("TPb")){closeOP(4);closeOP(0);ObjectDelete("KSb");ObjectDelete("TPb");}
    if(TS>0 && GetLine("TPs")>0 && Ask<GetLine("TPs")){closeOP(5);closeOP(1);ObjectDelete("KSs");ObjectDelete("TPs");}
    
    if(TB>0 && SS>0){closeOP(5);ObjectDelete("KSs");ObjectDelete("TPs");}
    if(TS>0 && BS>0){closeOP(4);ObjectDelete("KSb");ObjectDelete("TPb");}
    
    if(Display){
    double spread = NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD),2);   
    double profitB=PRB;
    double profitS=PRS;
    double profitAll= AccountProfit();
    color copitall=clrLightGray;
    color copit=clrLightGray;
    color copitb=clrLightGray;
    color copits=clrLightGray;
    color cop=clrLightGray;
    color coline=clrBlack;
    if (profitAll>0) {copit=clrLime;}  if (profitAll<0) {copit=clrRed;}
    if (profitB>0) {copitb=clrLime;}  if (profitB<0) {copitb=clrRed;}
    if (profitS>0) {copits=clrLime;}  if (profitS<0) {copits=clrRed;}
    double fmargin= AccountFreeMargin();
    color cfmargin=clrWhite;
    
    if (fmargin>0) {cfmargin=clrGreenYellow;} if (fmargin<0) {cfmargin=clrRed;} if (fmargin==0) {cfmargin=clrYellow;}
    TextPosA ("ea",WindowExpertName(),9,10,18,clrDodgerBlue,1);
    TextPosA ("magic","Magic  "+DoubleToStr(Magic,0),8,10,33,clrRed,1);
    
    TextPosA ("xnomer","ACCOUNT : "+DoubleToStr(AccountNumber(),0),8,10,60,warnatxt,1);
    TextPosA ("xnama","NAMA : "+AccountName(),8,10,75,warnatxt,1);
    
    TextPosA ("line1","==============================",8,10,90,clrDimGray,1);
    
    TextPosA ("leverage","Leverage  1:"+DoubleToStr(AccountLeverage(),0)+"      Spread   "+DoubleToStr(spread,0),8,10,105,warnatxt,1);
    TextPosA ("balance","BALANCE",8,100,125,clrGreenYellow,1);
    TextPosA ("equity","EQUITY",8,10,125,clrGreenYellow,1);
    TextPosA ("nilaibalance","$ "+DoubleToStr(AccountBalance(),2),8,100,140,clrGreenYellow,1);
    TextPosA ("nilaiequity","$ "+DoubleToStr(AccountEquity(),2),8,10,140,clrGreenYellow,1);
    
    TextPosA ("fmargin","F-Margin",8,100,170,cfmargin,1);
    TextPosA ("margin","Margin",8,10,170,cfmargin,1);
    
    TextPosA ("nilaifmargin","$ "+DoubleToStr(AccountFreeMargin(),2),8,100,185,cfmargin,1);
    TextPosA ("nilaimargin","$ "+DoubleToStr(AccountMargin(),2),8,10,185,cfmargin,1);
    
    
    double jbn=TB;
    double jsn=TS;
    if(jsn>0 || jbn>0){cop=clrYellowGreen;}
    
    TextPosA ("buy","Buy   "+DoubleToStr(jbn,0)+"  |  Lot "+DoubleToStr(LTB,2)+"  |  Profit $ "+DoubleToStr(profitB,2),8,10,215,copitb,1);
    TextPosA ("sell","Sell   "+DoubleToStr(jsn,0)+"  |  Lot "+DoubleToStr(LTS,2)+"  |  Profit $ "+DoubleToStr(profitS,2),8,10,230,copits,1);
    TextPosA ("line2","==============================",8,10,240 ,clrDimGray,1);
    TP();
    TextPosA ("Prof","Jumlah TP "+totTP+" ~ SL "+totSL,8,10,255,cfmargin,1);
    
    TextPosB ("Time","[TimeServer | "+TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS)+"]",8,550,1,clrGoldenrod,1);
    TextPosC ("and","Copyright ©2018 by Ahmad Habibi",7,10,25,clrGoldenrod,3);
    TextPosC ("CP","[FB | https://www.facebook.com/ismi.habibi.7]",8,10,10,clrDimGray,3);
    }
             
    return(0);
      }
    //+------------------------------------------------------------------+
    ini koding ea nya belum lengkap.. kalau mau bantu , nanti saya share yang full koding
    ===================
    Auto Profit dan Wd konsisten
    EA FIBO JUNIOR 2019
    ===================

  6. #1215
    Banned
    Kagum
     
    kendo is a jewel in the rough kendo is a jewel in the rough kendo is a jewel in the rough kendo is a jewel in the rough kendo's Avatar
    Join Date
    Feb 2019
    Location
    Bekasi
    Posts
    726
    Accumulated bonus
    74 USD (What is this?)
    Thanks
    184
    Thanked 360 Times in 235 Posts
    Quote Originally Posted by BenPorah View Post
    Alhamduliilah akhirnya clear juga EA Heiken ane, langsung test di akun riil nih Gan....
    lihat.... si martin nampak rajin memartil......... hehehe... masih tetep pake templat om Dwi neeh....
    Hallo om......saya perhatikan bagus juga gan EA nya...jika boleh tahu lebih lanjut, kira-kira berapa harga untuk EA nya ya kalau saya ingin beli???? adakah tutorial penggunaannya?? apakah dia tahan terhadap News High Impact...biasanya setahu saya banyak EA yang tumbang saat menghadapi News Besar.

    Mohon pencerahannya.

  7. The Following User Says Thank You to kendo For This Useful Post:

    Unregistered (1)

  8. #1216
    Harian
    ----
     
    donks17 is on a distinguished road donks17's Avatar
    Join Date
    Feb 2019
    Posts
    52
    Accumulated bonus
    2 USD (What is this?)
    Thanks
    5
    Thanked 22 Times in 19 Posts
    mau mempersingkat coding. ada nemu indikator average untuk menghitung range rata2 harian selama 20hari.. mohon bantuan dari para suhu coding . . . thankss

    int start()
    {
    int counted_bars=IndicatorCounted();
    //----
    double Ravg;
    double dR;

    for (int i=1; i<20; i++)
    {
    dR = (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
    Ravg = dR/20;
    }

    objectCreate("Range",300,15,DoubleToStr(Ravg,1),8, "Arial Narrow",Red);
    //----
    return(0);
    }

  9. #1217
    Forum Resident
    ----
     
    Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana has a reputation beyond repute Duryudana's Avatar
    Join Date
    Apr 2016
    Posts
    5,816
    Accumulated bonus
    6993 USD (What is this?)
    Saya bertemu tamu
    1 (detail lebih lanjut)
    Thanks
    21,405
    Thanked 16,900 Times in 9,311 Posts
    ane lagi cari robot atau EA yg berpedoman pada lsju kecepatan pergerakan harga. seperti, "jika harga bergerak 5 pips dalam tempo 1 menit berarti OP".
    adakah robot tersebut? atau setidaknya contoh script dalam coding MQL. terimakasih atas bantuannya.
    Cuma butuh 1 detik untuk klik "thanks" dan semoga diberi tiket sukses bersama forex

  10. #1218
    Orang Asing
    ----
     
    Agan498 is an unknown quantity at this point Agan498's Avatar
    Join Date
    Feb 2019
    Posts
    7
    Accumulated bonus
    0 USD (What is this?)
    Thanks
    0
    Thanked 4 Times in 3 Posts
    Mohon bantuanNya?

    Adakah yang bisa bantu, saya pingin Ea di kasih TP dollar.
    Jadi semisal dalam 1 hari saya menargetkan profit $5 maka Ea akan No trade atau tidak akan OP lagi?

    Terima kasih atas bantuannya?

  11. lamborghini
  12. #1219
    Orang Lama
    Semilir
     
    amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo is a glorious beacon of light amtwoxtwo's Avatar
    Join Date
    Sep 2010
    Location
    Sekitaran Bumi
    Posts
    1,014
    Accumulated bonus
    133 USD (What is this?)
    Thanks
    96
    Thanked 563 Times in 294 Posts
    Quote Originally Posted by anakmami View Post
    saya punya ea, mau saya edit untuk peraturan close/SL nya, apakah bisa bantu? ini ea close berdasarkan candle break dan di berbagai time frame, mau di ubah dalam hitungan pips saja untuk SL nya..

    Code:
    //+------------------------------------------------------------------+
    //|                                                EA FIBO X v3.mq4 |
    //|                                                    Ahmad Habibi |
    //|                                                    Ahmad Habibi |
    //+------------------------------------------------------------------+
    #property copyright "Ahmad Habibi"
    #property link      "Ahmad Habibi"
    #property version   "1.00"
    #property strict
    //+------------------------------------------------------------------+
    //| Expert initialization function                                   |
    //+------------------------------------------------------------------+
    
    datetime Expired      = D'30.12.2025'; // Ganti tanggal expired disini (Hari-Bulan-Tahun)
    
    string NamaEA="EA FIBO X";
    extern string   Owner1       = "===== Copyright ©2018 by Ahmad Habibi =====";//=====================================
    input  double   LotsX        = 0.01;    // Lots PO Konfirmasi
    input  double   Lots1        = 0.01;   // Lots Level 1
    input  double   Lots2        = 0.02;   // Lots Level 2
    input  double   Lots3        = 0.03;   // Lots Level 3
    input  double   Lots4        = 0.04;   // Lots Level 4
    input  double   Lots5        = 0.05;   // Lots Level 5
    input  string   Ct_          = "-----< Level Fibo >-----"; //=====================================
    input  double   Bs           = 127.2;   // Buy Stop
    input  double    TPb         = 200;     // TP Buy
    input  double   KSb          = 70;      // Konfirmasi Buy Stop
    input  double   Ss           = -27.2;   // Sell Stop
    input  double   TPs          = -100;    // TP Sell
    input  double   KSs          = 30;      // Konfirmasi Sell Stop
    input  ENUM_TIMEFRAMES TF    = 5;       // Close Timeframe
    input  string   Box_         = "-----< Setting Fibo >-----";//=====================================
    input  int      Start        = 9;      // Start candle
    input  int      End          = 10;     // End candle
    input  int      MinBox       = 1;      // Min Range HiLo (Pip)
    input  int      MAxBox       = 60;     // Max Range HiLo(Pip)
    input  string   Other_       = "-----< Other >-----"; //=====================================
    input  int      Magic        = 123;  // MagicNumber
    input  string   comment      = "EA FIBO X"; // Comment
    input  bool     Display      = true; // Display
    
    color    warnabox     = clrGray;//Warna Box
    int      Slippage     = 10;   // Max Slippage
    
    string COLORS = "==< COLOR >==";
    color  BoxColor      = clrBlue;
    color  RangeColor    = clrYellow;
    color  TPBuyColor    = clrAqua;
    color  TPSellColor   = clrDeepPink;
    color  CandleUpColor = clrLime;
    color  CandleDnColor = clrWhite;
    color  PercentColor  = clrWhite;
    
    int    TextSize          = 8; 
    int    AdjustArrowUp     = 8; 
    int    AdjustArrowDown   = 8; 
    
    
    int count,xx=0,i=0,tb=0,ts=0;
    double hi,lo;
    double TPbuy1,TPbuy2,TPbuy3,TPsell1,TPsell2,TPsell3;
    double theRange;
    int CandleHour;
    
    
    color timeColor = clrGold;
    //---- buffers
    color  warnatxt = clrAqua;// Warna Text
    ENUM_BASE_CORNER Info_Corner = 0;
    ulong muc,muc1;
    string ac,sec;
    double s1[];
    datetime t1;
    bool ab1,ab2,ab3,as1,as2,as3,bb,bs;
    double pt,SetPoint;
    int I,en;
    int gagalpobuy=4;
    int gagalposell=3;
    datetime timeStart;
    datetime st1;
    int shift,cnt=0;
    datetime tm1,tm2;
    int Warna;
    int turun        = 0;
    double minlot=0,maxlot=0;
    double xbawah=0,xatas=0;
    double lotv=0,Lots=0;
    int LEVEL=0;
    string totTP="",totSL="";
    int OnInit()
      {
    //---
       if (Digits == 3 || Digits == 5){SetPoint =10*Point;}
       if (Digits == 2 || Digits == 4){SetPoint = Point;}
       
       
       ChartSetInteger(0,CHART_SHOW_GRID,0,FALSE);      
       ChartSetInteger(0,CHART_SHOW_PERIOD_SEP,0,TRUE);
       ChartSetInteger(0,CHART_MODE,TRUE);
       ChartSetInteger(0,CHART_COLOR_CHART_UP,clrLime); 
       ChartSetInteger(0,CHART_COLOR_CANDLE_BULL,clrLime);    
       ChartSetInteger(0,CHART_COLOR_CHART_DOWN,clrRed); 
       ChartSetInteger(0,CHART_COLOR_CANDLE_BEAR,clrRed);    
       
        minlot=MarketInfo(Symbol(),MODE_MINLOT);
        maxlot=MarketInfo(Symbol(),MODE_MAXLOT);
        
        
       ObjectsDeleteAll();
       start();
    //---
       return(INIT_SUCCEEDED);
      }
    //+------------------------------------------------------------------+
    //| Expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
      {
    //---
       
      }
    //+------------------------------------------------------------------+
    //| Expert tick function                                             |
    //+------------------------------------------------------------------+
    int start()
      {
    //---
    if (TimeCurrent() > Expired) {Comment("EXPIRED");return(0);}
    
    //EA================================================================================================================================
       int  TO=0,TB=0,TS=0,SS=0,BS=0;
       double PRB=0,PRS=0,LTB=0,LTS=0,prices=0,priceb=0,ltb=0,lts=0;datetime tmb=0,tml=0;string cms="";
       for (i=0;i<OrdersTotal();i++){
       xx=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
          if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1))
            {TB++;TO++;PRB=PRB+OrderProfit()+OrderCommission()+OrderSwap();LTB+=OrderLots();priceb=OrderOpenPrice();ltb=OrderLots();tmb=OrderOpenTime();}
          if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1))
            {TS++;TO++;PRS=PRS+OrderProfit()+OrderCommission()+OrderSwap();LTS+=OrderLots();prices=OrderOpenPrice();lts=OrderLots();tmb=OrderOpenTime();}
          if(OrderType()==OP_BUYSTOP && OrderSymbol()==Symbol()  && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1)){BS++;}
          if(OrderType()==OP_SELLSTOP && OrderSymbol()==Symbol() && (OrderMagicNumber()==Magic|| OrderMagicNumber()==Magic+1)){SS++;}  
           }
          
          if(TB==1 && GetLine("KSb")>0 && BS==0 && Bid<GetLine("KSb")){
             xx=OrderSend(Symbol(),OP_BUYSTOP,LotsX,priceb,Slippage,0,0,comment+" ~ Konfir  ",Magic+1,0,clrGreen);
          }
          if(TS==1 && GetLine("KSs")>0 && SS==0 && Bid>GetLine("KSs")){
             xx=OrderSend(Symbol(),OP_SELLSTOP,LotsX,prices,Slippage,0,0,comment+" ~ Konfir  ",Magic+1,0,clrGold);
          }
    
             datetime today = iTime(Symbol(),1440,0);
             string jam1 = TimeToStr(today,TIME_DATE)+" "+IntegerToString(Start)+":00";
             string jam2 = TimeToStr(today,TIME_DATE)+" "+IntegerToString(End)+":00";
             if(Start<10){jam1 = TimeToStr(today,TIME_DATE)+" 0"+IntegerToString(Start)+":00";}
             if(End<10){jam2 = TimeToStr(today,TIME_DATE)+" 0"+IntegerToString(End)+":00";}
             
             double Up=ObjectGet("GHBox", OBJPROP_PRICE1);
             double Lo=ObjectGet("GHBox", OBJPROP_PRICE2);
             datetime tm=(datetime)ObjectGet("GHBox", OBJPROP_TIME2);
          
             if(TimeCurrent()>StrToTime(jam2) && TimeCurrent()-20*60<StrToTime(jam2) && TimeDay(tm)!=Day() && TO==0){
             xbawah=0;xatas=0;
             /*
             int jum=(End-Start);
             int val_index=iHighest(NULL,PERIOD_H1,MODE_HIGH,jum,1);
             if (val_index!=-1) xatas=High[val_index]; 
             
             int val_index2=iLowest(NULL,PERIOD_H1,MODE_LOW,jum,1);
             if (val_index2!=-1) xbawah=Low[val_index2];
             */
             for(i=0;i<200;i++){
                if(Time[i]<StrToTime(jam2) && Time[i]>=StrToTime(jam1)){
                   if(xbawah==0){xbawah=Low[i];}
                   if(xbawah>Low[i]){xbawah=Low[i];}
                   if(xatas==0){xatas=High[i];}
                   if(xatas<High[i]){xatas=High[i];}
                }
                if(Time[i]<StrToTime(jam1)){break;}
             }
             
             
             if(xatas>0 && xatas-xbawah>MinBox*SetPoint && xatas-xbawah<MAxBox*SetPoint){
             ivar031 ("GHBox",StrToTime(jam1),xatas,StrToTime(jam2),xbawah,warnabox,1, STYLE_SOLID, true);
             }
            }
             
             if(xatas-xbawah<MinBox*SetPoint && TO==0  && TimeCurrent()>StrToTime(jam2)){info("Tidak order Range HiLo kecil");}
             else if(xatas-xbawah>MAxBox*SetPoint && TO==0  && TimeCurrent()>StrToTime(jam2)){info("Tidak order Range HiLo Besar");}
             else{ObjectDelete("M1");}
    
       double UP=ObjectGet("GHBox", OBJPROP_PRICE1);
       double LO=ObjectGet("GHBox", OBJPROP_PRICE2);
       Comment("UP ",UP,"\nLO ",LO,"\n",HS());
    
    if(UP>0 && LO>0 && TO==0 && BS==0 && !HS()){
       double BB  =(UP-LO)/100;
       double rg  =NormalizeDouble(LO+(Bs*BB),Digits);
       
       double tpb=NormalizeDouble(LO+(TPb*BB),Digits);
       SetLine("TPb",NormalizeDouble(tpb,Digits));
       SetLine("KSb",NormalizeDouble(LO+(KSb*BB),Digits));
       lv();
       xx=OrderSend(Symbol(),OP_BUYSTOP,Lots,rg,Slippage,0,0,comment+" ~ Level  "+IntegerToString(LEVEL),Magic,0,clrGreen);
    }
    
    if(UP>0 && LO>0 && TO==0 && SS==0 && !HS()){
       double BB  =(UP-LO)/100;
       double rgs  =LO;
       if(Ss>0){rgs  =NormalizeDouble(LO+(Ss*BB),Digits);}
       if(Ss<0){double rgX=0;rgX-=Ss;
       rgs  =NormalizeDouble(LO-(rgX*BB),Digits);}
       
       double tps  =LO;
       if(TPs>0){tps  =NormalizeDouble(LO+(TPs*BB),Digits);}
       if(TPs<0){double tpX=0;tpX-=TPs;
       tps  =NormalizeDouble(LO-(tpX*BB),Digits);}
       SetLine("KSs",NormalizeDouble(LO+(KSs*BB),Digits));
       SetLine("TPs",NormalizeDouble(tps,Digits));
       lv();
       xx=OrderSend(Symbol(),OP_SELLSTOP,Lots,rgs,Slippage,0,0,comment+" ~ Level  "+IntegerToString(LEVEL),Magic,0,clrGold);
    }
    
    if(TB>0 && tmb<iTime(NULL,TF,1) && iClose(NULL,TF,1)<LO && LO>0 && iClose(NULL,TF,1)>0){closeOP(4);closeOP(0);ObjectDelete("KSb");ObjectDelete("TPb");}
    if(TS>0 && tmb<iTime(NULL,TF,1) && iClose(NULL,TF,1)>UP && UP>0 && iClose(NULL,TF,1)>0){closeOP(5);closeOP(1);ObjectDelete("KSs");ObjectDelete("TPs");}
    
    if(TB>0 && GetLine("TPb")>0 && Bid>GetLine("TPb")){closeOP(4);closeOP(0);ObjectDelete("KSb");ObjectDelete("TPb");}
    if(TS>0 && GetLine("TPs")>0 && Ask<GetLine("TPs")){closeOP(5);closeOP(1);ObjectDelete("KSs");ObjectDelete("TPs");}
    
    if(TB>0 && SS>0){closeOP(5);ObjectDelete("KSs");ObjectDelete("TPs");}
    if(TS>0 && BS>0){closeOP(4);ObjectDelete("KSb");ObjectDelete("TPb");}
    
    if(Display){
    double spread = NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD),2);   
    double profitB=PRB;
    double profitS=PRS;
    double profitAll= AccountProfit();
    color copitall=clrLightGray;
    color copit=clrLightGray;
    color copitb=clrLightGray;
    color copits=clrLightGray;
    color cop=clrLightGray;
    color coline=clrBlack;
    if (profitAll>0) {copit=clrLime;}  if (profitAll<0) {copit=clrRed;}
    if (profitB>0) {copitb=clrLime;}  if (profitB<0) {copitb=clrRed;}
    if (profitS>0) {copits=clrLime;}  if (profitS<0) {copits=clrRed;}
    double fmargin= AccountFreeMargin();
    color cfmargin=clrWhite;
    
    if (fmargin>0) {cfmargin=clrGreenYellow;} if (fmargin<0) {cfmargin=clrRed;} if (fmargin==0) {cfmargin=clrYellow;}
    TextPosA ("ea",WindowExpertName(),9,10,18,clrDodgerBlue,1);
    TextPosA ("magic","Magic  "+DoubleToStr(Magic,0),8,10,33,clrRed,1);
    
    TextPosA ("xnomer","ACCOUNT : "+DoubleToStr(AccountNumber(),0),8,10,60,warnatxt,1);
    TextPosA ("xnama","NAMA : "+AccountName(),8,10,75,warnatxt,1);
    
    TextPosA ("line1","==============================",8,10,90,clrDimGray,1);
    
    TextPosA ("leverage","Leverage  1:"+DoubleToStr(AccountLeverage(),0)+"      Spread   "+DoubleToStr(spread,0),8,10,105,warnatxt,1);
    TextPosA ("balance","BALANCE",8,100,125,clrGreenYellow,1);
    TextPosA ("equity","EQUITY",8,10,125,clrGreenYellow,1);
    TextPosA ("nilaibalance","$ "+DoubleToStr(AccountBalance(),2),8,100,140,clrGreenYellow,1);
    TextPosA ("nilaiequity","$ "+DoubleToStr(AccountEquity(),2),8,10,140,clrGreenYellow,1);
    
    TextPosA ("fmargin","F-Margin",8,100,170,cfmargin,1);
    TextPosA ("margin","Margin",8,10,170,cfmargin,1);
    
    TextPosA ("nilaifmargin","$ "+DoubleToStr(AccountFreeMargin(),2),8,100,185,cfmargin,1);
    TextPosA ("nilaimargin","$ "+DoubleToStr(AccountMargin(),2),8,10,185,cfmargin,1);
    
    
    double jbn=TB;
    double jsn=TS;
    if(jsn>0 || jbn>0){cop=clrYellowGreen;}
    
    TextPosA ("buy","Buy   "+DoubleToStr(jbn,0)+"  |  Lot "+DoubleToStr(LTB,2)+"  |  Profit $ "+DoubleToStr(profitB,2),8,10,215,copitb,1);
    TextPosA ("sell","Sell   "+DoubleToStr(jsn,0)+"  |  Lot "+DoubleToStr(LTS,2)+"  |  Profit $ "+DoubleToStr(profitS,2),8,10,230,copits,1);
    TextPosA ("line2","==============================",8,10,240 ,clrDimGray,1);
    TP();
    TextPosA ("Prof","Jumlah TP "+totTP+" ~ SL "+totSL,8,10,255,cfmargin,1);
    
    TextPosB ("Time","[TimeServer | "+TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS)+"]",8,550,1,clrGoldenrod,1);
    TextPosC ("and","Copyright ©2018 by Ahmad Habibi",7,10,25,clrGoldenrod,3);
    TextPosC ("CP","[FB | https://www.facebook.com/ismi.habibi.7]",8,10,10,clrDimGray,3);
    }
             
    return(0);
      }
    //+------------------------------------------------------------------+
    ini koding ea nya belum lengkap.. kalau mau bantu , nanti saya share yang full koding
    Code:
    if(TB>0 && tmb<iTime(NULL,TF,1) && iClose(NULL,TF,1)<LO && LO>0 && iClose(NULL,TF,1)>0){closeOP(4);closeOP(0);ObjectDelete("KSb");ObjectDelete("TPb");}
    if(TS>0 && tmb<iTime(NULL,TF,1) && iClose(NULL,TF,1)>UP && UP>0 && iClose(NULL,TF,1)>0){closeOP(5);closeOP(1);ObjectDelete("KSs");ObjectDelete("TPs");}
    
    if(TB>0 && GetLine("TPb")>0 && Bid>GetLine("TPb")){closeOP(4);closeOP(0);ObjectDelete("KSb");ObjectDelete("TPb");}
    if(TS>0 && GetLine("TPs")>0 && Ask<GetLine("TPs")){closeOP(5);closeOP(1);ObjectDelete("KSs");ObjectDelete("TPs");}
    
    if(TB>0 && SS>0){closeOP(5);ObjectDelete("KSs");ObjectDelete("TPs");}
    if(TS>0 && BS>0){closeOP(4);ObjectDelete("KSb");ObjectDelete("TPb");}
    ini mau diganti SL pips yg spt apa?
    BEP+pips ?

    ---------- Post added at 11:58 ---------- Previous post was at 11:56 ----------

    Quote Originally Posted by donks17 View Post
    mau mempersingkat coding. ada nemu indikator average untuk menghitung range rata2 harian selama 20hari.. mohon bantuan dari para suhu coding . . . thankss

    int start()
    {
    int counted_bars=IndicatorCounted();
    //----
    double Ravg;
    double dR;

    for (int i=1; i<20; i++)
    {
    dR = (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
    Ravg = dR/20;
    }

    objectCreate("Range",300,15,DoubleToStr(Ravg,1),8, "Arial Narrow",Red);
    //----
    return(0);
    }
    ini masalahnya dmn pak?
    Yahuuu

Page 122 of 122
FirstFirst ... 22 72 112 120 121 122

Posting Permissions

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