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 I found a good EA, but EA needs breakeven. Who will help ???

Discussion in 'Expert Advisor atau Robot Forex' started by Lipton, 16 Feb 2019.

  1. Lipton

    Lipton Member Credit Hunter

    Equity
    Credit
    Ref Point
    Hello.
    EA needs Breakeven.Please help.
     

    Attached Files:

    • han.mq4
      File size:
      32.5 KB
      Views:
      84
    • Winner Winner x 1
  2. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
  3. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
    the scrolling ratio is very high when entering and exiting operations. therefore, it never matches the back test.
     
  4. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
    I worked in detail. my opinion. To be successful '' number of trade to be entered in that bar '', the setting is to add.
     
  5. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
    input bool LimitBar=true; // Limitar 1 ordem por vela?
    input int MaxOrders = 2;

    datetime LastOrderBar; // Store the last candle with opened order


    void OnTick(){

    //... code above, not important
    //... MySignalPoint --> Is the point i allow the buy/swll
    //... Not here because is too large and is not on the scope of this thread

    // If LimitBar is TRUE, check if last order was in the current bar
    // If LimitBar is FALSE, set true to bar_none_order to allow more orders on same bar
    bool bar_none_order = !LimitBar || LastOrderBar != Time[0];

    // If MaxOrders = 0, no_max_orders must be defined as TRUE, to not limit number of orders
    // If MaxOrders > 0, then check if opened orders of current the asset is smaller than MaxOrders, and if smaller,
    // set no_max_orders too, because need to allow new orders till reach the limit.
    bool no_max_orders = MaxOrders == 0 ||( CountOpenOrders() < MaxOrders );

    // Here i check if all conditions are true to allow opening orders
    if( bar_none_order && no_max_orders && MySignalPoint){
    Neworder(cmd); // BUY/SELL
    LastOrderBar = Time[0]; // Here i store the last bar that has an order opened
    }

    }


    int CountOpenOrders()
    {
    int count=0;

    for( int i=OrdersTotal()-1; i>=0; i--)
    {
    if( OrderSelect( i, SELECT_BY_POS ) )
    {
    if( OrderSymbol() == Symbol() && OrderMagicNumber() == MyMagicNumber ){
    count++;
    }
    }
    }

    return count;
    }
     
  6. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
    I found the code but I don't know how to add it.
     
  7. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
    code : Max Orders for 1 candle.
     
  8. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
    I tried to add this code to EA han
    but it is not working.
     
  9. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point

Share This Page