Join & EARN

FOREX ALGOS { }

What We Do

BlackBox

Backtest Results How It Works Full Refund Promise Supported Brokers Income Targets

Robots Glossary

Break-Even Logic

Break-Even Logic – A specific risk rule to move the stop-loss to the entry price once the trade has reached a specified profit (thus guaranteeing no loss). For example, “after 30 pips in profit, set stop-loss to entry.” This can be implemented by checking profit and, if reached, modifying the order.

  • Example (MQL4):

    if(PositionSelect(Symbol()) && PositionGetDouble(POSITION_PROFIT) >= 30*SymbolInfoDouble(_Symbol, SYMBOL_POINT))
    {
    double entry = PositionGetDouble(POSITION_PRICE_OPEN);
    double sl = entry; // move stop to break-even
    OrderModify(PositionGetInteger(POSITION_TICKET), entry, sl, 0);
    }