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 3 of 123
FirstFirst 1 2 3 4 5 13 53 103 ... LastLast
Results 21 to 30 of 1223

Thread: Tanya Jawab Seputar Coding MQL

  1. #21
    Penggemar
    Mengintai
     
    Money Profit is on a distinguished road Money Profit's Avatar
    Join Date
    Mar 2013
    Location
    Yogyakarta
    Posts
    344
    Accumulated bonus
    48 USD (What is this?)
    Thanks
    4
    Thanked 50 Times in 14 Posts
    Quote Originally Posted by BenPorah     
    Ok Bro... tetap semangat...!
    Berhubung ane penggila scalping makanya ane cari-cari terus sistem scalping yang mak nyuuuss..... uda nggak kehitung strategi, sistem maupun indi yang ane uleg-uleg ampe akhirnya si heiken yang bisa buat kayak gini...
    wiiidiih,, EA nya close market cepet banget yaa ...
    apa gak takut tuh om ??
    hehe ...

    okelah,, ntar kalo pas kopdar aja om sekalian bahas coding + EA yang diatas ntu ...
    barangkali om uda jago coding,, jadi ane sekalian numpang nambah ilmu ...
    hehe ...

    ---------- Post added at 04:59 AM ---------- Previous post was at 04:39 AM ----------

    Quote Originally Posted by ARock     
    maaf kalau ini ga sesuai thread gan

    mau tanya, hari ini gw dpt mail bunyinya:

    MetaQuotes, the company behind the MetaTrader platform, recently informed us that they are no longer allowing our Trade Terminal to be installed on the MetaTrader platform. As a result of their decision, use of the Trade Terminal will be blocked by MetaQuotes effective Friday, April 19th.

    This means that the following features will no longer function:
    1-click dealing boxes
    OCA orders and automated close rules
    'Close all' functionality
    Account based alerts such as "margin in use" and "equity"

    We strongly recommend that prior to Friday, April 19th you review your account and make any necessary adjustments. All other components on the MetaTrader client terminal will continue to function as normal.

    We are working hard to restore access to the Trade Terminal as quickly as possible. In the meantime, please contact us with any questions.



    waktu gw translate sih kayaknya meta quote ga bs dipake lagi cmiiw
    maap nih gan,, ane coba bantu jawab sebisa ane yaa ...
    soalnya dari dulu sampe sekarang ane belum pernah ngalamin hal semacam gitu ...

    "you review your account and make any necessary adjustments",, nah dari sini agan coba cek dulu deh akun agan,, sesuai gak dengan identitas asli agan ??
    jangan pernah pake fake ID gan kalo mau registrasi,, bisnis ini beda dengan bisnis yang lainnya ...

    ... Salah satu dari 3 amalan yang tidak terputus, meskipun orang tersebut sudah meninggal dunia adalah " Ilmu yang Bermanfaat " ...

    " Ilmu bermanfaat yang diberikan dengan tulus dan senantiasa digunakan dan bermanfaat bagi orang lain "


  2. <a href="https://www.mt5.com/id/">Forex Portal MT5</a>
  3. #22
    Anggota
    Bla
     
    BenPorah is on a distinguished road BenPorah's Avatar
    Join Date
    Nov 2011
    Location
    solo
    Posts
    141
    Accumulated bonus
    25 USD (What is this?)
    Thanks
    120
    Thanked 38 Times in 18 Posts
    Quote Originally Posted by Money Profit     
    wiiidiih,, EA nya close market cepet banget yaa ...
    apa gak takut tuh om ??
    hehe ...
    Ya Bro, sengaja ane bikin agak agresif, tapi aman kok .
    sampai ada pergerakan searah sebesar 192 pips tanpa ada koreksi 10 pips, baru agak limbung.
    tapi langka ada pergerakan segitu tanpa diselingi koreksi 10 pips aja, kecuali Gap.
    yaa.. klo uda weekend tinggal clear all position.... beres.

    Ati-ati aja Bro pake indi repain, mesti diselipin indi konfirmasinya, tapi akibatnya kadang EA jadi jarang OP.
    Yah... disitulah seninya meramu EA, kadang seperti buah simalakama....... Tetap semangaaaaaattt....... !

  4. #23
    Newbie
    ----
     
    akhmadfx is on a distinguished road akhmadfx's Avatar
    Join Date
    Apr 2013
    Location
    Surabaya
    Posts
    30
    Accumulated bonus
    4 USD (What is this?)
    Thanks
    0
    Thanked 9 Times in 7 Posts

    Red face Minta Tolong coding MQL5

    Ini ada Mq4 EA sederhana,
    tolong yang bisa kasih arahan bagaimana conversi code ke Mq5 nya, thx before

    PHP Code:

    #include <stdlib.mqh>
    #include <WinUser32.mqh>

    // exported variables
    extern int BuyStoploss2 20;
    extern int BuyTakeprofit2 30;
    extern int PriceOffset2 20;
    extern double BalanceRiskPercent2 5;


    // local variables
    double PipValue=1;    // this variable is here to support 5-digit brokers
    bool Terminated false;
    string LF "\n";  // use this in custom or utility blocks where you need line feeds
    int NDigits 4;   // used mostly for NormalizeDouble in Flex type blocks
    int ObjCount 0;  // count of all objects created on the chart, allows creation of objects with unique names
    int current 0;



    int init()
    {
        
    NDigits Digits;
        
        if (
    falseObjectsDeleteAll();      // clear the chart
        
        
        
    Comment("");    // clear the chart
    }

    // Expert start
    int start()
    {
        if (
    Bars 10)
        {
            
    Comment("Not enough bars");
            return (
    0);
        }
        if (
    Terminated == true)
        {
            
    Comment("EA Terminated.");
            return (
    0);
        }
        
        
    OnEveryTick1();
        
    }

    void OnEveryTick1()
    {
        if (
    true == false && truePipValue 10;
        if (
    true && (NDigits == || NDigits == 5)) PipValue 10;
        
        
    BuyPendingRiskFixed2();
        
    }

    void BuyPendingRiskFixed2()
    {
        
    double lotsize MarketInfo(Symbol(),MODE_LOTSIZE) / AccountLeverage();
        
    double pipsize 10;
        
    double maxlots AccountBalance() / 100 BalanceRiskPercent2 lotsize pipsize;
        if (
    BuyStoploss2 == 0) Print("OrderSend() error - stoploss can not be zero");
        
    double lots maxlots BuyStoploss2 10;
        
        
    // calculate lot size based on current risk
        
    double lotvalue 0.001;
        
    double minilot MarketInfo(Symbol(), MODE_MINLOT);
        
    int powerscount 0;
        while (
    minilot 1)
        {
            
    minilot minilot MathPow(10powerscount);
            
    powerscount++;
        }
        
    lotvalue NormalizeDouble(lotspowerscount 1);
        
        if (
    lotvalue MarketInfo(Symbol(), MODE_MINLOT))    // make sure lot is not smaller than allowed value
        
    {
            
    lotvalue MarketInfo(Symbol(), MODE_MINLOT);
        }
        if (
    lotvalue MarketInfo(Symbol(), MODE_MAXLOT))    // make sure lot is not greater than allowed value
        
    {
            
    lotvalue MarketInfo(Symbol(), MODE_MAXLOT);
        }
        
        
    int expire TimeCurrent() + 60 60;
        
    double price NormalizeDouble(AskNDigits) + PriceOffset2*PipValue*Point;
        
    double SL price BuyStoploss2*PipValue*Point;
        if (
    BuyStoploss2 == 0SL 0;
        
    double TP price BuyTakeprofit2*PipValue*Point;
        if (
    BuyTakeprofit2 == 0TP 0;
        if (
    60 == 0expire 0;
        
    int ticket OrderSend(Symbol(), OP_BUYSTOPlotvalueprice4SLTP"EA sederhana"1expireBlue);
        if (
    ticket == -1)
        {
            Print(
    "OrderSend() error - "ErrorDescription(GetLastError()));
        }
        
    }



    int deinit()
    {
        if (
    falseObjectsDeleteAll();
        
        


  5. #24
    Penggemar
    Mengintai
     
    Money Profit is on a distinguished road Money Profit's Avatar
    Join Date
    Mar 2013
    Location
    Yogyakarta
    Posts
    344
    Accumulated bonus
    48 USD (What is this?)
    Thanks
    4
    Thanked 50 Times in 14 Posts
    Quote Originally Posted by BenPorah     
    Ya Bro, sengaja ane bikin agak agresif, tapi aman kok .
    sampai ada pergerakan searah sebesar 192 pips tanpa ada koreksi 10 pips, baru agak limbung.
    tapi langka ada pergerakan segitu tanpa diselingi koreksi 10 pips aja, kecuali Gap.
    yaa.. klo uda weekend tinggal clear all position.... beres.

    Ati-ati aja Bro pake indi repain, mesti diselipin indi konfirmasinya, tapi akibatnya kadang EA jadi jarang OP.
    Yah... disitulah seninya meramu EA, kadang seperti buah simalakama....... Tetap semangaaaaaattt....... !
    emang main di TF berapa om EA nya ??
    ane gak pake indi konfirmasi,, tapi ane siasati dengan Pending Order kalo ada trending kuat ...
    om bisa gak nyelipin coding Pending Order dalam coding Martingale ??
    Jadi kalo uda mencapai MaxOrder Martingale,, EA akan buka PO yang berlawanan ...
    logika nya seperti itu ...
    kalo bisa mohon dibantu om ane ...

    Quote Originally Posted by akhmadfx     
    Ini ada Mq4 EA sederhana,
    tolong yang bisa kasih arahan bagaimana conversi code ke Mq5 nya, thx before

    PHP Code:

    #include <stdlib.mqh>
    #include <WinUser32.mqh>

    // exported variables
    extern int BuyStoploss2 20;
    extern int BuyTakeprofit2 30;
    extern int PriceOffset2 20;
    extern double BalanceRiskPercent2 5;


    // local variables
    double PipValue=1;    // this variable is here to support 5-digit brokers
    bool Terminated false;
    string LF "\n";  // use this in custom or utility blocks where you need line feeds
    int NDigits 4;   // used mostly for NormalizeDouble in Flex type blocks
    int ObjCount 0;  // count of all objects created on the chart, allows creation of objects with unique names
    int current 0;



    int init()
    {
        
    NDigits Digits;
        
        if (
    falseObjectsDeleteAll();      // clear the chart
        
        
        
    Comment("");    // clear the chart
    }

    // Expert start
    int start()
    {
        if (
    Bars 10)
        {
            
    Comment("Not enough bars");
            return (
    0);
        }
        if (
    Terminated == true)
        {
            
    Comment("EA Terminated.");
            return (
    0);
        }
        
        
    OnEveryTick1();
        
    }

    void OnEveryTick1()
    {
        if (
    true == false && truePipValue 10;
        if (
    true && (NDigits == || NDigits == 5)) PipValue 10;
        
        
    BuyPendingRiskFixed2();
        
    }

    void BuyPendingRiskFixed2()
    {
        
    double lotsize MarketInfo(Symbol(),MODE_LOTSIZE) / AccountLeverage();
        
    double pipsize 10;
        
    double maxlots AccountBalance() / 100 BalanceRiskPercent2 lotsize pipsize;
        if (
    BuyStoploss2 == 0) Print("OrderSend() error - stoploss can not be zero");
        
    double lots maxlots BuyStoploss2 10;
        
        
    // calculate lot size based on current risk
        
    double lotvalue 0.001;
        
    double minilot MarketInfo(Symbol(), MODE_MINLOT);
        
    int powerscount 0;
        while (
    minilot 1)
        {
            
    minilot minilot MathPow(10powerscount);
            
    powerscount++;
        }
        
    lotvalue NormalizeDouble(lotspowerscount 1);
        
        if (
    lotvalue MarketInfo(Symbol(), MODE_MINLOT))    // make sure lot is not smaller than allowed value
        
    {
            
    lotvalue MarketInfo(Symbol(), MODE_MINLOT);
        }
        if (
    lotvalue MarketInfo(Symbol(), MODE_MAXLOT))    // make sure lot is not greater than allowed value
        
    {
            
    lotvalue MarketInfo(Symbol(), MODE_MAXLOT);
        }
        
        
    int expire TimeCurrent() + 60 60;
        
    double price NormalizeDouble(AskNDigits) + PriceOffset2*PipValue*Point;
        
    double SL price BuyStoploss2*PipValue*Point;
        if (
    BuyStoploss2 == 0SL 0;
        
    double TP price BuyTakeprofit2*PipValue*Point;
        if (
    BuyTakeprofit2 == 0TP 0;
        if (
    60 == 0expire 0;
        
    int ticket OrderSend(Symbol(), OP_BUYSTOPlotvalueprice4SLTP"EA sederhana"1expireBlue);
        if (
    ticket == -1)
        {
            Print(
    "OrderSend() error - "ErrorDescription(GetLastError()));
        }
        
    }



    int deinit()
    {
        if (
    falseObjectsDeleteAll();
        
        

    waah,, ane belum bisa menguasai coding mql5 om ...

    ... Salah satu dari 3 amalan yang tidak terputus, meskipun orang tersebut sudah meninggal dunia adalah " Ilmu yang Bermanfaat " ...

    " Ilmu bermanfaat yang diberikan dengan tulus dan senantiasa digunakan dan bermanfaat bagi orang lain "


  6. #25
    Newbie
    ----
     
    akhmadfx is on a distinguished road akhmadfx's Avatar
    Join Date
    Apr 2013
    Location
    Surabaya
    Posts
    30
    Accumulated bonus
    4 USD (What is this?)
    Thanks
    0
    Thanked 9 Times in 7 Posts

    Red face Need help modifikasi

    Ini ada EA MQL5, simple EA Buy pending order

    Bagaimana cara nya untuk menambahkan Money management Fixed Risk di dalam EA nya,
    artinya modifikasi EA menjadi auto lot size tergantung balance akun nya,

    Please para master coding minta advice nya.

    PHP Code:

    #include <Trade\Trade.mqh>

    // exported variables
    input double Lots5 1;
    input int Stoploss5 5;
    input int Takeprofit5 100;
    input int PriceOffset5 0;


    // local variables
    double PipValue=1;    // this variable is here to support 5-digit brokers
    bool Terminated false;
    string LF "\n";  // use this in custom or utility blocks where you need line feeds
    int NDigits 4;   // used mostly for NormalizeDouble in Flex type blocks
    int ObjCount 0;  // count of all objects created on the chart, allows creation of objects with unique names
    int current 0;



    //+------------------------------------------------------------------+
    //| Expert initialization function                                   |
    //+------------------------------------------------------------------+
    int OnInit()
    {
        
    //---
        
    NDigits Digits();
        if (
    NDigits == || NDigits == 5PipValue 10;
        
        if (
    AccountInfoInteger(ACCOUNT_TRADE_EXPERT) == false)
        {
            Print(
    "Check terminal options because EA trade option is set to not allowed.");
            
    Comment("Check terminal options because EA trade option is set to not allowed.");
        }
        
        if (
    falseObjectsDeleteAll(0);      // clear the chart
        
        
        
    Comment("");    // clear the chart
        //---
        
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
    {
        
    //---
        
    if (falseObjectsDeleteAll(0);
        
        
    }
    //+------------------------------------------------------------------+
    //| Expert tick function                                             |
    //+------------------------------------------------------------------+
    void OnTick()
    {
        
    //---
        
    if (Terminated == true)
        {
            
    Comment("EA Terminated.");
        }
        
        
    OnEveryTick1();
    }

    //+------------------------------------------------------------------+
    //| Get Low for specified bar index                                  |
    //+------------------------------------------------------------------+
    double Low(int index)
    {
        
    double arr[];
        
    double low 0;
        
    ArraySetAsSeries(arrtrue);
        
    int copied CopyLow(Symbol(), PERIOD_CURRENT0Bars(Symbol(), PERIOD_CURRENT), arr);
        if (
    copied>&& index<copiedlow arr[index];
        return (
    low);
    }
    //+------------------------------------------------------------------+
    //| Get the High for specified bar index                             |
    //+------------------------------------------------------------------+
    double High(int index)
    {
        
    double arr[];
        
    double high 0;
        
    ArraySetAsSeries(arrtrue);
        
    int copied CopyHigh(Symbol(), PERIOD_CURRENT0Bars(Symbol(), PERIOD_CURRENT), arr);
        if (
    copied>&& index<copiedhigh=arr[index];
        return(
    high);
    }
    //+------------------------------------------------------------------+
    //| Get Close for specified bar index                                |
    //+------------------------------------------------------------------+
    double Close(int index)
    {
        
    double arr[];
        
    double close 0;
        
    ArraySetAsSeries(arrtrue);
        
    int copied CopyClose(Symbol(), PERIOD_CURRENT0Bars(Symbol(), PERIOD_CURRENT), arr);
        if (
    copied>&& index<copiedclose arr[index];
        return (
    close);
    }
    //+------------------------------------------------------------------+
    //| Get Open for specified bar index                                 |
    //+------------------------------------------------------------------+
    double Open(int index)
    {
        
    double arr[];
        
    double open 0;
        
    ArraySetAsSeries(arrtrue);
        
    int copied CopyOpen(Symbol(), PERIOD_CURRENT0Bars(Symbol(), PERIOD_CURRENT), arr);
        if (
    copied>&& index<copiedopen arr[index];
        return (
    open);
    }
    //+------------------------------------------------------------------+
    //| Get current bid value                                            |
    //+------------------------------------------------------------------+
    double Bid()
    {
        return (
    SymbolInfoDouble(Symbol(), SYMBOL_BID));
    }

    //+------------------------------------------------------------------+
    //| Get current ask value                                            |
    //+------------------------------------------------------------------+
    double Ask()
    {
        return (
    SymbolInfoDouble(Symbol(), SYMBOL_ASK));
    }

    //+------------------------------------------------------------------+
    //| Is there an error                                                |
    //+------------------------------------------------------------------+
    bool IsError(MqlTradeResultresultstring function)
    {
        if (
    result.retcode != && result.retcode != TRADE_RETCODE_DONE && result.retcode != TRADE_RETCODE_PLACED)
        {
            Print(
    "Function: ", function, " Error: "result.retcode" "result.comment);
            return (
    true);
        }
        else
        Print(
    "> Executed: [", function, "]");
        return (
    false);
    }

    bool IsError(CTradetradestring function)
    {
        if (
    trade.ResultRetcode() != && trade.ResultRetcode() != TRADE_RETCODE_DONE && trade.ResultRetcode() != TRADE_RETCODE_PLACED)
        {
            Print(
    "Function: ", function, " Error: "trade.ResultRetcode(), " "trade.ResultRetcodeDescription());
            return (
    true);
        }
        else
        Print(
    "> Executed: [", function, "]");
        return (
    false);
    }

    //+------------------------------------------------------------------+
    //| Get indicator value back                                         |
    //+------------------------------------------------------------------+
    double GetIndicator(int handleint buffer_numint index)
    {
        
    //--- array for the indicator values
        
    double arr[];    
        
    //--- obtain the indicator value in the last two bars
        
    if (CopyBuffer(handlebuffer_num0index+1arr) <= 0)
        {        
            
    Sleep(200);
            for(
    int i=0i<100i++)
            {
                if (
    BarsCalculated(handle) > 0)
                break;
                
    Sleep(50);
            }
            
    int copied CopyBuffer(handlebuffer_num0index+1arr);
            if (
    copied <= 0)
            {
                Print(
    "CopyBuffer failed. Maybe history has not download yet? Error = "GetLastError());
                return -
    1;
            }
            else
            return (
    arr[index]);
        }
        else
        {
            return (
    arr[index]);
        }
        
        return 
    0;
    }

    //+------------------------------------------------------------------+
    //| Building blocks                                                  |
    //+------------------------------------------------------------------+
    void OnEveryTick1()
    {
        
        if (
    NDigits == || NDigits == 5PipValue 10;
        
        
    OncePerBar2();
        
    }

    void OncePerBar2()
    {
        static 
    datetime Old_Time;
        
    datetime New_Time[1];
        
    // copying the last bar time to the element New_Time[0]
        
    int copied CopyTime(Symbol(), Period(), 01New_Time);
        if (
    copied 0)     // ok, the data has been copied successfully
        
    {
            if (
    Old_Time != New_Time[0]) // if old time isn't equal to new bar time
            
    {
                
    Old_Time=New_Time[0];            // saving bar time
                
    BuyPendingOrder25();
                
            }
            else
            {
                return;     
    // still the same bar
            
    }
        }
        else
        {
            
    Alert("Error in copying historical times data, error =",GetLastError());
            
    ResetLastError();
            return;
        }
    }

    void BuyPendingOrder25()
    {
        
        
    double price NormalizeDouble(High(2), NDigits) - PriceOffset5*PipValue*Point();
        
    double SL price Stoploss5*PipValue*Point();
        if (
    Stoploss5 == 0SL 0;
        
    double TP price Takeprofit5*PipValue*Point();
        if (
    Takeprofit5 == 0TP 0;
        
        
    //--- prepare a request
        
    MqlTradeRequest request;
        
    ZeroMemory(request);
        
    request.action=TRADE_ACTION_PENDING;         // setting a pending order
        
    request.magic 1;                  // ORDER_MAGIC
        
    request.symbol Symbol();                      // symbol
        
    request.volume Lots5;                          // volume in 0.1 lots
        
    request.sl SL;                                // Stop Loss is not specified
        
    request.tp TP;                                // Take Profit is not specified
        
    request.deviation 3;                         // deviation in 5 points
        
    request.price price;
        
    request.type_time ORDER_TIME_SPECIFIED;
        
    request.expiration TimeTradeServer()+PeriodSeconds(PERIOD_D1)-2;
        
    //--- form the order type
        
    request.type ORDER_TYPE_BUY_STOP;           // order type ORDER_TYPE_BUY_LIMIT, ORDER_TYPE_SELL_LIMIT, ORDER_TYPE_BUY_STOP, ORDER_TYPE_SELL_STOP
        //--- form the price for the pending order
        
    MqlTradeResult result;
        
    ZeroMemory(result);
        
    OrderSend(request,result);
        
    // check the result
        
    if (!IsError(result__FUNCTION__))
        {
            
        }
        
        
        
        
        
        
        
        
        
        
        
        
        
        


  7. #26
    Anggota
    Bla
     
    BenPorah is on a distinguished road BenPorah's Avatar
    Join Date
    Nov 2011
    Location
    solo
    Posts
    141
    Accumulated bonus
    25 USD (What is this?)
    Thanks
    120
    Thanked 38 Times in 18 Posts
    [QUOTE=akhmadfx;2353891]Ini ada EA MQL5, simple EA Buy pending order

    Bagaimana cara nya untuk menambahkan Money management Fixed Risk di dalam EA nya,
    artinya modifikasi EA menjadi auto lot size tergantung balance akun nya,

    Please para master coding minta advice nya.

    Coba tambahkan ini :
    [PHP]

    #include <Trade\Trade.mqh>
    #define MAGICMA 12345
    // exported variables
    input double Lots5 = 1;
    input int Stoploss5 = 5;
    input int Takeprofit5 = 100;
    extern double MaximumRisk = 2;
    extern double DecreaseFactor = 3;

    input int PriceOffset5 = 0;
    Code:
    //+------------------------------------------------------------------+
    //| Calculate open positions                                         |
    //+------------------------------------------------------------------+
    int CalculateCurrentOrders(string symbol)
      {
       int buys=0,sells=0;
    //----
       for(int i=0;i<OrdersTotal();i++)
         {
          if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
          if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGICMA)
            {
             if(OrderType()==OP_BUY)  buys++;
             if(OrderType()==OP_SELL) sells++;
            }
         }
    //---- return orders volume
       if(buys>0) return(buys);
       else       return(-sells);
      }
    //+------------------------------------------------------------------+
    //| Calculate optimal lot size                                       |
    //+------------------------------------------------------------------+
    double LotsOptimized()
      {
       double lot=Lots;
       int    orders=HistoryTotal();     // history orders total
       int    losses=0;                  // number of losses orders without a break
    //---- select lot size
       lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/1000.0,1);
    //---- calcuulate number of losses orders without a break
       if(DecreaseFactor>0)
         {
          for(int i=orders-1;i>=0;i--)
            {
             if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; }
             if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;
             //----
             if(OrderProfit()>0) break;
             if(OrderProfit()<0) losses++;
            }
          if(losses>1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
         }
    //---- return lot size
       if(lot<0.1) lot=0.1;
       return(lot);
      }
    Last edited by BenPorah; 04-15-2013 at 18:45.

  8. #27
    Harian
    Sibuk
     
    ARock is an unknown quantity at this point ARock's Avatar
    Join Date
    Apr 2013
    Location
    Indonesia
    Posts
    49
    Accumulated bonus
    6 USD (What is this?)
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by astrella     
    yang bener boss,.. ??? saya baru mau mulai lagi trading...
    klo meta quates gq ada agaimana balikin modal yg dah MC............ hadah pusing dong...
    aw.... sorry gan, rupanya setelah gw tanya ke resepsionisnya katanya broker yg gw pake ga ngijinin pake EA mulai 19 april ntar lemes dah gw, sana sini nyari robot dan blajar ga taunya ga boleh di pake.
    asem

  9. #28
    Anggota
    Bla
     
    BenPorah is on a distinguished road BenPorah's Avatar
    Join Date
    Nov 2011
    Location
    solo
    Posts
    141
    Accumulated bonus
    25 USD (What is this?)
    Thanks
    120
    Thanked 38 Times in 18 Posts
    Quote Originally Posted by ARock     
    aw.... sorry gan, rupanya setelah gw tanya ke resepsionisnya katanya broker yg gw pake ga ngijinin pake EA mulai 19 april ntar lemes dah gw, sana sini nyari robot dan blajar ga taunya ga boleh di pake.
    asem
    Lah... emang pake broker apa ? kok aneh, masak pake EA gak boleh... ?
    ya udah, pindah dimari aja Gan.

  10. #29
    Penggemar
    Mengintai
     
    Money Profit is on a distinguished road Money Profit's Avatar
    Join Date
    Mar 2013
    Location
    Yogyakarta
    Posts
    344
    Accumulated bonus
    48 USD (What is this?)
    Thanks
    4
    Thanked 50 Times in 14 Posts
    misi om yang uda ngerti coding + master coding ...
    ane butuh bantuan nih ...

    gimana cara nambahin codingan Pending Order yang benar di codingan Martingale ini ...
    ane BT masih ada error invalid lots nya ...

    PHP Code:
    if(OrdersTotal()>=1)
       {
        for(
    iCount=0iCount<OrdersTotal(); iCount++)
            {
             
    OrderSelect(iCount,SELECT_BY_POS,MODE_TRADES);
               
             if(
    OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==Magic)
               {
                if(
    LastOP==0) {LastOP=OrderOpenPrice();}
                if(
    LastOP>OrderOpenPrice()) {LastOP=OrderOpenPrice();}
                if(
    LastLots<OrderLots()) {LastLots=OrderLots();}
                
    LastIsBuy=TRUE;
                
    iTotalBuy++;
                
                if(
    iTotalBuy==MaxTrade) {return(0);}
               }
             
             if(
    OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==Magic)
               {
                if(
    LastOP==0) {LastOP=OrderOpenPrice();}
                if(
    LastOP<OrderOpenPrice()) {LastOP=OrderOpenPrice();}         
                if(
    LastLots<OrderLots()) {LastLots=OrderLots();}
                
    LastIsBuy=FALSE;
                
    iTotalSell++;
                
                if(
    iTotalBuy==MaxTrade) {return(0);}
               }
             
            }      
             
          
    /* Jika arah Price adalah DOWNTREND...., Periksa nilai Bid (*/
          
    if(LastIsBuy)
            {
             if(
    Bid<=LastOP-(Spread*SetPoint)-(PipStep*SetPoint))
               {
                
    OrderSend(Symbol(), OP_BUYMultiply*LastLotsAskSlippage0Ask+TakeProfit*SetPointEACommentMagic);   
                
    ModifyTP();
                
    LastIsBuy=FALSE;
                if(
    iTotalBuy==MaxTrade-1)
                  {
                   
    ticket=OrderSend(Symbol(),OP_SELLSTOP,LotSell,NextSell,Slippage,0,0,EAComment,Magic,0,CLR_NONE);
                   if(
    ticket>0) if(OrderSelect(ticketSELECT_BY_TICKETMODE_TRADES)) OrderPrint();
                   if(
    GetLastError()==138RefreshRates();
                  }
                return(
    0);
               }
            }
          
    /* Jika arah Price adalah Sell...., Periksa nilai Ask (*/
          
    else if(!LastIsBuy)
            {
             if(
    Ask>=LastOP+(Spread*SetPoint)+(PipStep*SetPoint))
               {
                
    OrderSend(Symbol(), OP_SELLMultiply*LastLotsBidSlippage0Bid-TakeProfit*SetPointEACommentMagic);           
                
    ModifyTP();
                if(
    iTotalSell==MaxTrade-1)
                  {
                   
    ticket=OrderSend(Symbol(),OP_BUYSTOP,LotBuy,NextBuy,Slippage,0,0,EAComment,Magic,0,CLR_NONE);
                   if(
    ticket>0) if(OrderSelect(ticketSELECT_BY_TICKETMODE_TRADES)) OrderPrint();
                   if(
    GetLastError()==138RefreshRates();
                  }
                return(
    0);
               }
            }
            
         } 
    PHP Code:
       double lotstep=MarketInfo(Symbol(), MODE_LOTSTEP);
       
    double stoplevelMarketInfo(Symbol(), MODE_STOPLEVEL);
       
    double LotSell=MathMax(Multiply*OrderLots(),OrderLots()+lotstep);
       
    double LotBuy=MathMax(Multiply*OrderLots(),OrderLots()+lotstep);
       
    double NextSell=Bid-JarakOP*MarketInfo(Symbol(),MODE_POINT);
       
    double NextBuy=Ask+JarakOP*MarketInfo(Symbol(),MODE_POINT); 
    o iyaa, sekalian mau tanya ...
    EA apa yang punya rule Buy/Sell Limit + Buy/Sell Stop yaa ...

    mohon dibantu ...

    ... Salah satu dari 3 amalan yang tidak terputus, meskipun orang tersebut sudah meninggal dunia adalah " Ilmu yang Bermanfaat " ...

    " Ilmu bermanfaat yang diberikan dengan tulus dan senantiasa digunakan dan bermanfaat bagi orang lain "


  11. #30
    Harian
    Sibuk
     
    ARock is an unknown quantity at this point ARock's Avatar
    Join Date
    Apr 2013
    Location
    Indonesia
    Posts
    49
    Accumulated bonus
    6 USD (What is this?)
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by BenPorah     
    Lah... emang pake broker apa ? kok aneh, masak pake EA gak boleh... ?
    ya udah, pindah dimari aja Gan.
    di Ga*n Capit*l gan. Iya ini jg lg nabung buat ngumpulin modal. klo yg di GC ditarik sayang gan abisnya blm balik modal. Klo ditarik bisa2 rugi 50% mana biaya transfer lewat kawatnya jg lumayan. Gpp dah manual drpd ga masuk market tp loss. Klo loss di market plg ga kan ada pengalamannya.

Page 3 of 123
FirstFirst 1 2 3 4 5 13 53 103 ... 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