A breakout strategy that enters immediately after a close above resistance can react to a brief price excursion. Requiring two consecutive completed closes above a fixed reference provides a different, testable entry policy. The goal is to measure the trade-off between delayed participation and fewer short-lived breakouts, not to assume confirmation improves returns.

Define the event before coding

Use a fixed illustrative resistance level of 100.00 and require two consecutive closes strictly above it. A close equal to or below the level resets the counter. A signal occurs only when the counter first reaches two, not on every subsequent qualifying bar. The following sequence demonstrates why the reset matters.

How to Confirm Breakout Entries with Consecutive Closes in ProOrder
Two consecutive closes above 100 confirm the breakout; a close at or below 100 resets the counter.
Bar Close Counter Decision
1 100.50 1 Wait
2 99.50 0 Reset
3 101.00 1 Wait
4 102.00 2 Entry signal if flat
5 101.50 3 No fresh signal

Implement the counter in ProOrder

Place DEFPARAM at the top of the trading system. ONCE initializes the counter once during execution; subsequent bar calculations update it. CumulateOrders=False prevents ordinary same-direction accumulation, while NOT ONMARKET explicitly requires a flat strategy position for this entry. This code demonstrates a long-only entry fragment, not a deployable trading system. It intentionally uses a constant reference to isolate the confirmation logic.

DEFPARAM CumulateOrders = False
ONCE aboveCount = 0
referenceLevel = 100
confirmBars = 2

IF close > referenceLevel THEN
    aboveCount = aboveCount + 1
ELSE
    aboveCount = 0
ENDIF

IF NOT ONMARKET AND aboveCount = confirmBars THEN
    BUY 1 CONTRACT AT MARKET
ENDIF

// Illustrative entry fragment only.
// Integrate independent protective exits and session rules.

With normal bar-close evaluation, an order generated by a completed bar is intended for execution after that decision, conventionally the next bar's opening in a bar-based backtest. In the example, bar 4 is the signal bar, not a guaranteed fill at 102.00. A gap can make the actual entry materially different. Include independent stop and exit logic, instrument-appropriate quantity and execution constraints before deployment.

From a constant level to a dynamic resistance

When using a rolling range, avoid allowing the reference to follow the current breakout bar's high. One alternative is to derive resistance from preceding completed bars and freeze the reference when a confirmation sequence begins. Define when it expires and how it resets. Comparing each close with a moving threshold instead is a different strategy: two qualifying closes might refer to two different levels. Test these designs separately.

Operational edge cases

  • When a confirmation occurs while already in a position, the equality-based rule discards it. It does not queue the signal until the position closes.
  • Decide whether the streak may cross session boundaries. For an intraday-only policy, reset it at the validated beginning of each trading session.
  • A restarted or reloaded strategy may reconstruct its counter from historical bars; verify that a live entry is not generated from stale eligibility or unresolved orders.
  • Do not treat the counter as an order acknowledgement. Review actual ProOrder execution and broker position before assuming an entry succeeded.

Compare the cost of confirmation

Test confirmation lengths of one, two and three with identical resistance logic, exits, instrument, dates, costs and quantity. Compare signal counts, actual modeled entries, average net trade, drawdown and the entry delay relative to the first qualifying close. For example, the first close in the successful sequence above is 101.00, but the second is 102.00: the confirmation costs one price unit at the signal level, before any execution differences. Review out-of-sample periods rather than selecting the best historical setting alone.

Confirmation filters can miss profitable breakouts and cannot eliminate false signals. Market orders, gaps and transaction costs introduce additional risks.

Official reference: the ProOrder programming guide available through the ProRealTime help manuals.

This educational excerpt has not been compiled or backtested here. Trading involves risk of loss; simulated results do not guarantee future performance.

To adapt this free strategy idea to your own trading rules, contact us about Custom ProRealTime strategy Development Services.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.