TradeViora AcademyLearn. Analyze. Practice. Trade Smarter.
Menu

FREE FINANCIAL EDUCATION

Deduplicating structural events

Study deduplicating structural events through mechanisms, a synthetic worked case, practice, and explained assessment.

Market Structure

APPLIED STUDY · ORIGINAL LESSON

Learning plan and prerequisites

Before you begin: Complete first-passage break rules, level expiry and recovery events.

Mechanism and interpretation

A level can be crossed, revisited and crossed again. Counting every bar beyond it as an independent structural break inflates the sample. This lesson uses an armed/disarmed event machine for one stored upper reference L. Initially the reference is armed. The first close strictly above L records one event and disarms it. While disarmed, later closes above L update the same episode. Rearm only after two consecutive completed closes at or below L. A subsequent strict crossing then starts a new episode with a new identifier.

Use a composite key containing reference ID, direction and episode number. A repeated data delivery for the same timestamp must not create another event. Distinct levels can also generate simultaneous events; those are separate geometric references but may share one underlying market move. For statistical analysis, record their common time or cluster rather than assuming independence. Deduplication defines what is counted; it does not itself remove all dependence among surviving events.

Worked case — synthetic data

A synthetic stored high L=100 starts armed. Closes are 100.5,101,99,99.5 and 100.2. The first close records episode 1 and disarms the reference. Close 101 is an update, not a second break. Close 99 begins a below-or-equal counter of 1. Close 99.5 raises it to 2 and rearms the reference after that observation. Close 100.2 then creates episode 2. There are two break episodes, not three events from the three closes above 100.

If the middle sequence were 99,100.4,99.5, the two qualifying reset closes would not be consecutive. The 100.4 observation interrupts the counter, so the reference remains disarmed and the later 99.5 starts a new counter at 1. This prevents an implementation from rearming after any two below-level observations regardless of intervening prices. The stored level must also remain eligible; an expired reference cannot create a new episode merely because the reset condition is met.

Context and failure modes

Different research questions may allow only one lifetime event per level or may require a new confirmed swing before rearming. These are valid alternative designs when specified beforehand. An OHLC rule can cross and reset within one bar, requiring finer data or an explicit sequence assumption. Log excluded duplicates and their reason so counts can be reconciled. Removing duplicates after inspecting their returns can bias the sample just as much as counting them repeatedly.

Practice task

L=50 starts armed. Closes are 51,52,50,49 and 50.5. Apply the same two-consecutive-reset rule. Give the event observations and explain whether the equality 50 contributes to rearming.

Worked practice answer

Observation 1 creates episode 1; observation 2 is an update. Equality 50 at observation 3 qualifies as the first reset close because the rule uses at-or-below. Observation 4 completes the reset, and observation 5 creates episode 2. Event observations are 1 and 5.

Topic assessment

Choose an answer before opening each explanation. These questions test the specific mechanism in this lesson.

1. Why is close 101 not a second case event?

  1. The reference is already disarmed within the same episode
  2. It is below 100
  3. It creates a new confirmed pivot automatically
Reveal answer and explanation

A. Repeated above-level observations update an existing event until rearming.

2. What resets the below-level counter in the alternative path?

  1. A second below-level close
  2. The intervening 100.4 close above L
  3. Any new timestamp
Reveal answer and explanation

B. The rule requires consecutive qualifying reset observations.

3. What should be retained for simultaneous breaks of nearby levels?

  1. An assumption of complete independence
  2. Only the most profitable event
  3. Their shared timing or cluster relationship
Reveal answer and explanation

C. Separate reference IDs can still describe dependent observations of one market movement.

Primary references and scope

Original explanation and synthetic calculations. Chart thresholds are explicit research conventions, not exchange rules or proof of predictive ability.