Forex Community Place

Dapatkan hingga
$50000
karena mengundang teman
untuk memperoleh Bonus StartUp
dari InstaForex
Tidak perlu investasi!
Dapatkan bonus
55%
ke akun anda!
Results 1 to 4 of 4

Thread: (ask) Perintah Order 1X Tiap Pair

  1. #1 Collapse Post
    Orang Asing
    ----
     
    aliaja is an unknown quantity at this point aliaja's Avatar
    Join Date
    May 2012
    Location
    Kendal ,Jawa Tengah
    Posts
    8
    Accumulated bonus
    0 USD (What is this?)
    Thanks
    2
    Thanked 3 Times in 2 Posts

    Smile (ask) Perintah Order 1X Tiap Pair

    Met sore gan ,bantuannya untuk membuat perintah order 1x dalam satu pair ,
    ketika tidak ada total order yang terbuka maka akan order
    aku coba EA code dibawah ini ,jadi OP terus ini ..harusnya cukup 1X OP Saja ,,ketika semua order sudah aku close harusnya op lagi ...ketika sudah ada order di 1 pair itu tidak akan OP lagi
    mohon bantuannya gan ,,terimakasih
    Code:
    extern int TakeProfit = 20;
    extern int StopLoss = 20;
    extern int Slippage = 3;
    
    
    //+------------------------------------------------------------------+
    //| expert initialization function |
    //+------------------------------------------------------------------+
    int init()
     {
    //----
    
    //----
     return(0);
     }
    //+------------------------------------------------------------------+
    //| expert deinitialization function |
    //+------------------------------------------------------------------+
    int deinit()
     {
    //----
    
    //----
     return(0);
     }
    //+------------------------------------------------------------------+
    //| expert start function |
    //+------------------------------------------------------------------+
    int start()
     {
    //----
     
     OrderSend("EURUSD",OP_BUY, 0.01, Ask, Slippage, Bid-StopLoss*Point, Ask+TakeProfit*Point, "BELI", 12345, 0, Green); 
    OrderSend("GBPUSD",OP_BUY, 0.01, Ask, Slippage, Bid-StopLoss*Point, Ask+TakeProfit*Point, "BELI", 12345, 0, Green); 
     
    }

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

    Unregistered (2)

  3. #2 Collapse Post
    Orang Asing
    Suci
     
    stadevata is an unknown quantity at this point stadevata's Avatar
    Join Date
    Mar 2020
    Location
    JOGLOSEMAR
    Posts
    3
    Accumulated bonus
    0 USD (What is this?)
    Thanks
    0
    Thanked 1 Time in 1 Post
    kalau gak salah ni bang ...
    di cek dulu apakah sudah ada order yg terbuka apa belom ..

    int ticket,magic_number;
    for (int i = OrdersTotal()-1 ; i >= 0 ; i--) {
    if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)>0 && OrderSymbol() == "EURUSD" && magic_number == 12345)
    {
    ticket=OrderSend("EURUSD",OP_BUY, 0.01, Ask, Slippage, Bid-StopLoss*Point, Ask+TakeProfit*Point, "BELI", 12345, 0, Green);
    } else {Print ("Sudah ada Order Bang !!!");}
    }

  4. #3 Collapse Post
    Orang Asing
    ----
     
    aliaja is an unknown quantity at this point aliaja's Avatar
    Join Date
    May 2012
    Location
    Kendal ,Jawa Tengah
    Posts
    8
    Accumulated bonus
    0 USD (What is this?)
    Thanks
    2
    Thanked 3 Times in 2 Posts
    Quote Originally Posted by stadevata     
    kalau gak salah ni bang ...
    di cek dulu apakah sudah ada order yg terbuka apa belom ..

    int ticket,magic_number;
    for (int i = OrdersTotal()-1 ; i >= 0 ; i--) {
    if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)>0 && OrderSymbol() == "EURUSD" && magic_number == 12345)
    {
    ticket=OrderSend("EURUSD",OP_BUY, 0.01, Ask, Slippage, Bid-StopLoss*Point, Ask+TakeProfit*Point, "BELI", 12345, 0, Green);
    } else {Print ("Sudah ada Order Bang !!!");}
    }
    saya coba tidak mau open order gan ,

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

    Unregistered (1)

  6. <a href="https://www.mt5.com/id/forex_humor">Forex Portal MT5</a>
  7. #4 Collapse Post
    Poster Lama
    ----
     
    ting tong is a glorious beacon of light ting tong is a glorious beacon of light ting tong is a glorious beacon of light ting tong is a glorious beacon of light ting tong is a glorious beacon of light ting tong is a glorious beacon of light ting tong's Avatar
    Join Date
    Jul 2013
    Location
    Indonesia
    Posts
    3,024
    Accumulated bonus
    495 USD (What is this?)
    Thanks
    1,840
    Thanked 552 Times in 439 Posts
    OrderSend("EURUSD" dan OrderSend("GBPUSD"
    harus ada pemisah dulu,,,,mau di pisah secara symbol atau mau di pisah secara magic number kakka.
    ea tempel 1 chart untuk order multipair ya kakka..?

    buat array nya dulu mungkin kayak nya kakka,,

    Code:
    int GetCurrentTradeTrend(string pair,int magic_n)
    {
    RefreshRates();
    int total = OrdersTotal();
    int counts=0;
    for (int cnt = 0 ; cnt < total ; cnt++)
    {
    if(OrderSelect(cnt,SELECT_BY_POS)== true && OrderSymbol()==pair && OrderMagicNumber()== Magic_Number && OrderType()==OP_BUY)
    return 1;
    if(OrderSelect(cnt,SELECT_BY_POS)== true && OrderSymbol()==pair && OrderMagicNumber()== Magic_Number && OrderType()==OP_SELL)
    return -1;
    }
    return 0;
    }
    abis itu mungkin bisa di panggil kakka untuk check order kakak,,,

    Code:
    int currenttradeTrend    = GetCurrentTradeTrend(TradePairs[i],Magic_Number);
    TradePairs[i]
    adalah kumpulan dr beberapa symbol yg mau di tradingkan kakka,,
    Concentrate on your Losses and Profits will take care of itself

Posting Permissions

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