Back to builder reference

Condition

eod_flatten
exit

End-of-day flatten exit: the position is flat from N minutes before the session close until the close. At close - N (resolved against the DATE's real close, so a half-day flattens early instead of being missed) it closes the position and cancels any resting entry; entries decided in the window are skipped as policy:eod_flat_window. A daily/hourly entry filling at the open is flattened the same session. A scheduled entry at or after close - N is refused at compile. Attach it as its own exit. Equity only: refused for crypto (24h sessions have no close).

Category

Time & events

Discriminator

kind = "eod_flatten"

Roles

exit

Required fields

None.

Optional fields

flatten_minutes_before_closeintegerMinutes before session close at which to flatten, and from which the position stays flat until the close. Compiles to a scheduled exit at AnchorTrigger(close, -N) holding the flat window. Use at least 1 minute; 0 would require an official closing-auction print for market-on-close.
kindstring-
Quawd

A subscription SaaS platform for designing, backtesting, and paper-trading algorithmic trading strategies on equities and crypto — described in plain English to an AI agent, no code required.

© 2026 Quawd. All rights reserved.

Quawd is a software tool, not a broker-dealer or investment adviser, and does not provide investment advice. Trading involves substantial risk of loss. Backtested and hypothetical results have inherent limitations and are not indicative of future performance.