Not logged in

Forums

Viewing 1 post (of 1 total)

Forums>EA Wizard>Application Support>Looks like a Bug in generated code for "Bars Since Order Closed".

  • #197574 |
    Participant
    30 Posts

    Hi Thomas,

    Is this a bug?

    Look at the difference in the underlying code generated by EA wizard between “Bars Since Order Closed” and “Bars Since Order Open”?

    “Bars Since Order Open”

    int sqGetBarsSinceEntry(int orderMagicNumber) {
    for (int cc = OrdersTotal() – 1; cc >= 0; cc–) {
    if (OrderSelect(cc, SELECT_BY_POS) ) {

    if((orderMagicNumber == 0 || OrderMagicNumber() == orderMagicNumber) && OrderSymbol() == Symbol()) {
    return (sqGetBarsFromOrderOpen(1000));
    }
    }
    }

    return(-1);
    }

    “Bars Since Order Closed”

    int sqGetBarsSinceExit(int orderMagicNumber) {

    for(int i=OrdersHistoryTotal(); i>=0; i–) {
    if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==true) {

    if(OrderMagicNumber() == orderMagicNumber && OrderSymbol() == Symbol()) {
    return (sqGetBarsFromOrderClose(1000));
    }
    }
    }

    return(-1);
    }

    Is “Bars Since Order Closed” missing that OR condition?

    Thanks in advance

    Kind Regards
    Steve

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.