An intraday trading system may correctly identify a signal but submit it too late in the session. In ProOrder, simply limiting the hours shown on a chart is not the same as requiring a strategy to be flat overnight. A signal generated on the final bar of a reduced session can even produce an order at the next session's opening under the platform's documented execution rules. A robust intraday system separates its entry window from its exposure-management window and its mandatory flattening boundary.
Design three distinct time controls
Consider a hypothetical instrument with a configured 09:30–16:00 trading session and a five-minute main chart. All times in this example refer to the strategy's configured time zone, not necessarily the operator's computer or the exchange's daily calendar.
| Boundary | Time | Purpose |
|---|---|---|
| Earliest entry | 09:45 | Avoid opening during the initial 15 minutes. |
| Entry cutoff | 15:45 | Stop initiating new exposure. |
| Flatten boundary | 15:55 | Request closure and cancellation of remaining strategy orders before the scheduled close. |

The ten-minute interval between the entry cutoff and flatten boundary serves a different purpose from the entry window: it permits the strategy to continue managing existing risk without initiating another trade. At 15:40, a valid signal may still be eligible; at 15:45 and 15:50, the entry condition is false. An existing position should continue to receive its intended protective management during that interval.
What FlatBefore and FlatAfter actually do
ProOrder supports session-level constraints through DEFPARAM instructions. FlatBefore and FlatAfter impose a flat-position policy, not just an entry filter: they restrict new orders, cancel pending strategy orders and close strategy positions during the restricted time. They must fall inside the applicable market session to be effective. These settings are therefore unsuitable when a swing strategy deliberately wants to carry its position overnight.
There is also an important resolution constraint. On a five-minute chart aligned to 15:50 and 15:55, setting FlatAfter to 15:52 does not establish a hard deadline at 15:52. The official manual specifies that an intrabar FlatAfter takes effect at that bar's close, which in this example is 15:55. Use a boundary aligned to the actual main-series bar grid, and allow additional time before the market closes. A closure instruction cannot guarantee an immediate fill in a halted, closed or illiquid market.
ProOrder implementation: entry gate versus position policy
The following illustrative excerpt belongs in the ProBacktest/ProOrder trading-system editor, not a standalone chart indicator. Place DEFPARAM declarations at the top of the system. The variable longSignal is intentionally left for the existing strategy to define; this is not a complete executable strategy.
DEFPARAM CumulateOrders = False
DEFPARAM FlatBefore = 094500
DEFPARAM FlatAfter = 155500
entryAllowed = Time >= 094500 AND Time < 154500
// Integrate with the strategy's actual entry signal.
IF entryAllowed AND NOT OnMarket AND longSignal THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Keep existing protective exit logic outside the entry gate.
Time is the intraday bar-closing time represented numerically as HHMMSS. The strict comparison with 154500 excludes the closing bar at 15:45. CumulateOrders is disabled, and the position check prevents a new long request while the system is already on market. This does not replace an account-wide exposure or order-control policy. The quantity of one contract is illustrative; adapt it to the instrument, margin and risk budget. Do not put protective exits inside entryAllowed: doing so could stop recalculating dynamic exit instructions during the very period reserved for risk management.
Why customized chart hours are not a flat-position guarantee
ProOrder's official execution conditions distinguish ordinary entry/order instructions from position-linked SET STOP and SET TARGET instructions. With reduced trading hours, ordinary market, limit and stop-entry orders are constrained to the configured hours. Orders generated on the final bar may carry into the next session's first bar. Position-linked protective orders may still execute outside the reduced session while the underlying market remains open. The configured trading hours are captured when the system is deployed; changing the chart settings later does not update an already running system. Verify the deployed version and redeploy when the schedule needs to change.
Time zones, early closes and daylight saving
ProOrder associates the strategy with the configured intraday time zone at deployment. Intraday Time and FlatAfter follow that setting, whereas certain daily date-based instructions use the market's time zone. A calendar date and an intraday clock may therefore refer to different conventions. Document the actual deployment zone and inspect the instrument's bar timestamps. A normal 16:00 close and an early 13:00 close cannot safely share a hard-coded 15:55 flatten boundary without an additional operational policy. Validate holiday sessions and daylight-saving transitions; do not assume a fixed offset from UTC. If there are no bars before the deadline, the system cannot create a missing market event.
Four controlled tests in ProBacktest and paper operation
- Run the same signal logic with no session guard and then with the three boundaries. Compare order timestamps and next-session entries rather than only net profit.
- Generate valid signals at 15:40 and 15:45 and confirm the latter cannot initiate a trade. Inspect the actual submission and execution timestamps separately.
- Start with a position before 15:45, verify protective logic remains active, and confirm the 15:55 boundary requests flattening and cancellation. Repeat with a working entry order.
- Compare FlatAfter at 15:52 and 15:55 on the same five-minute data. Inspect early-close, delayed-price and gap scenarios separately using a controlled demo environment where available.
The test should preserve the same signal, instrument, commissions and slippage assumptions across configurations. Record the session hours, chart interval, strategy time zone, last entry signal time, last actual fill, flatten request and final confirmed exposure. Monitor deployed ProOrder systems for expiration, execution errors and account restrictions. The platform's automated shutdown behavior and broker connectivity may influence the actual exit outcome.
The code excerpt was checked against ProRealTime's programming documentation but has not been compiled or tested in the platform. Trading involves risk; session filters do not guarantee execution prices, eliminate overnight exposure under all market conditions, or ensure profitability.
Official references: Trading Systems programming manual, FlatBefore and FlatAfter section; ProOrder execution conditions.
If you would like to adapt an existing ProOrder system to instrument-specific sessions, risk limits or custom strategy controls, our Custom Trading Software Development Services can help implement the relevant logic.