Reply to Thread
Results 1 to 3 of 3

Thread: Kode menghitung profit yang sedang op buy dan op sell (masing-masing)

  1. #1
    Orang Asing
    ----
     
    alixcool is an unknown quantity at this point alixcool's Avatar
    Join Date
    Feb 2014
    Location
    Pekanbaru
    Posts
    6
    Accumulated bonus
    1.20 USD (What is this?)
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Kode menghitung profit yang sedang op buy dan op sell (masing-masing)

    Mohon bantuannya master2 bagaimana kode di MQL4 untuk menghitung profit yang sedang op buy dan op sell (masing-masing) ?

  2. FB_indo
  3. #2
    Orang Asing
    ----
     
    niam is an unknown quantity at this point niam's Avatar
    Join Date
    Jul 2012
    Posts
    1
    Accumulated bonus
    0.30 USD (What is this?)
    Thanks
    0
    Thanked 0 Times in 0 Posts
    pertanyaannya kurang detail
    semua pair atau hanya pair tertentu

    opnya properti nya gmana, magic number, sama comment nya.

    lebih detail kali aja bisa lanjut

  4. <a href="https://www.showfxworld.com/id">Forex Portal MT5</a>
  5. #3
    Orang Asing
    ----
     
    alixcool is an unknown quantity at this point alixcool's Avatar
    Join Date
    Feb 2014
    Location
    Pekanbaru
    Posts
    6
    Accumulated bonus
    1.20 USD (What is this?)
    Thanks
    0
    Thanked 0 Times in 0 Posts
    saya skrg menggunakan code berikut :

    double ld_40 = 0;
    for (li_0 = 0; li_0 < OrdersTotal(); li_0++) {
    OrderSelect(li_0, SELECT_BY_POS, MODE_TRADES);
    if (OrderSymbol() != Symbol() || OrderMagicNumber() != magic || OrderType() > OP_SELL) continue;
    ld_40 += OrderProfit();
    }
    if (ld_40 >= tp_in_money || g_count_264 > 0) {
    closeall();
    closeall();
    closeall();
    g_count_264++;
    if (total(0)+total(1) == 0) g_count_264 = 0;

    void closeall() {
    for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
    OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
    if (OrderSymbol() != Symbol() || OrderMagicNumber() != magic) continue;
    if (OrderType() > OP_SELL) OrderDelete(OrderTicket());
    else {
    if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
    else OrderClose(OrderTicket(), OrderLots(), Ask, 3, CLR_NONE);
    }
    }
    }

    tetapi itu jika profit (tp_in_money) sudah tercapai seluruh order di close, sementara saya mau memisanhkan masing-masing tp_in_money untuk posisi buy dan tp_in_money untuk posisi sell

Reply to Thread

Posting Permissions

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