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
}
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?