EA overtrading debugger

Stop an EA from opening duplicate trades on the same signal.

Debug an Expert Advisor that opens too many trades by checking persistent signals, new-bar detection, MaxOpenTrades, cooldown, magic-number filters, and duplicate-entry logs before retesting.

Common overtrading evidence

EA opened 12 trades on one signal
Signal=true on every tick
OpenOrdersCount=0 because MagicNumber filter is missing
LastEntryTime not checked
CooldownMinutes=0

These are state, ownership, and exposure-control failures. Fix the trade gate before optimizing entries or changing risk settings.

Debug duplicate EA entries
Separate persistent conditions from new signals
Check MaxOpenTrades, cooldown, and magic-number filters
Route opt-in source as overtrading debug interest
Find the duplicate-entry path

Audience

For MT4 and MT5 builders whose EA compiles but stacks repeated entries, opens on every tick, ignores max-trade rules, or cannot explain why duplicate orders were allowed.

Problem

Overtrading is usually a state-control issue. The signal condition stays true across many ticks, the EA does not remember that it already acted, or the order-count loop misses existing trades because symbol and magic-number filters are wrong.

Outcome

Workfusionapp keeps the repair path narrow: prove the signal transition, count owned trades correctly, add cooldown and max-open-trade guards, log duplicate blocks, then route the EA into the free debugging desk.

Support path

One problem, one fix path.

Start with the concrete blocker, keep the full EA context attached, then move to a reviewable output.

1. Detect a new signal instead of a persistent condition

Use a new-bar check, a previous-signal flag, or a state transition so the EA acts once when a setup appears instead of acting on every tick while the condition remains true.

2. Count only the trades the EA owns

Before sending another order, count open positions or orders by symbol and magic number. Log the count source so duplicate blocks are explainable.

3. Add cooldown and max-trade gates

Use MaxOpenTrades, one-trade-per-signal, and cooldown time or bars. If a duplicate is blocked, print the reason once with last entry time and next allowed time.

Workflow

From repeated entries to one auditable block reason.

The fix is not to weaken strategy logic until the test looks cleaner. The fix is to prove why the EA sends a second order, then block duplicates without hiding risk or ownership evidence.

Step 1

Paste the entry block and order-count loop

Step 2

Check new-bar or signal-edge detection

Step 3

Validate max-trade and cooldown gates

Step 4

Retest manually with duplicate-block logs

Overtrading handoff

Route repeated EA entries into the right duplicate-control path.

Open the guide that matches the failure, then run the free desk with entry conditions, order-count logic, magic number, last-entry state, and a small journal excerpt.

Max-trades cooldown guide

Use this when the EA needs MaxOpenTrades, cooldown minutes or bars, and a clear block reason before another order is sent.

Magic-number order management

Use this when the EA counts the wrong orders, misses its own positions, or manages trades without symbol and MagicNumber ownership filters.

Send me the overtrading debug workflow

Opt in only if your MT4 or MT5 EA opens too many trades, repeats entries on one signal, misses cooldown, or has unclear max-trade and magic-number logic. This captures the overtrading source for conversion measurement.

Intent locked: Paste compiler errors

Choose the workflow you want, then opt in only if you want Workfusionapp updates.

Should I reduce lot size instead of fixing duplicate entries?

No. Lot size does not fix a duplicate-entry bug. First prove and control when the EA is allowed to send another order.

Does this work for MT4 and MT5?

Yes. The exact APIs differ, but the debugging path is the same: signal state, owned-trade count, cooldown, max trades, and duplicate-block logs.

Does fixing overtrading prove the EA is profitable?

No. It only makes entry control more observable. Strategy quality still needs separate tester evidence, risk review, and manual validation.