Page 1 of 1

Putting the max spread filter in the EA before any entry logic

Posted: Mon Oct 19, 2026 1:02 pm
by FXS London Scalper
A small design choice with large consequences: check spread at the very start of the entry function, before computing signals.

Why first?
- It avoids computing signals that will be rejected anyway.
- It ensures that no code path skips the check (e.g. a signal branch added later that forgets to check spread).
- It makes logs cleaner: a skipped entry due to spread is logged once, clearly.

Structure:

Code: Select all

void CheckEntry() {
   if(!SpreadOK()) { LogSkip("spread"); return; }
   if(!SessionOK()) { LogSkip("session"); return; }
   if(!NewsOK())   { LogSkip("news"); return; }
   // signal logic below
}
SpreadOK() should compare current spread with a threshold that can vary by hour. Store thresholds in an input string or a small file so they can be changed without recompiling.

Bonus: log the spread at the moment the order is sent, not just at the check. They can differ by the time the order leaves.

Do you use guard clauses like this in your EAs?