Anonymized engineering sample

Pine Script MTF acceptance specification

A practical example of how a multi-timeframe indicator is made testable before coding: confirmation timing, look-ahead prevention, merge ownership, state transitions, alerts and chart evidence are frozen in writing.

This sample is about deterministic software behavior. It is not a trading signal, backtest result or profitability claim.

Open-source timing inspector

Download the companion Pine Script v6 diagnostic. It plots the last confirmed higher-timeframe close separately from the still-developing HTF close, exposes the state in a table and alerts when the prior HTF candle becomes fixed. It is an educational acceptance aid, not a trade signal.

Download Pine v6 source

Timing contract

EventEligible whenVisible behavior
Source pivotOnly after the full right-bar window closesNo historical level before confirmation
Lower-timeframe displayFirst eligible bar after source confirmationNo future value copied backward
Touch alertFirst tolerance entry after activationOnce per level event
Break alertConfirmed close beyond the invalidation ruleA wick alone does not break the level

State model

  1. 1

    Candidate

    A source pattern exists but still needs future bars to confirm.

  2. 2

    Confirmed

    The source event is knowable and may enter the active set.

  3. 3

    Active

    The level is visible and eligible for touch or break events.

  4. 4

    Touched

    Price entered tolerance; repeat alerts remain suppressed.

  5. 5

    Broken

    The approved invalidation event occurred and the level is retired.

Alert contract

  • Separate confirmed, touch, break and optional retest events.
  • Intrabar versus closed-bar timing is an explicit input decision.
  • Each event has a defined duplicate-suppression and re-arm rule.
  • Reload and symbol/timeframe changes reconstruct deterministic state.

Positive acceptance cases

  • A confirmed 4H resistance first appears on the eligible lower-timeframe bar and never moves afterward.
  • Daily and 4H resistance inside merge tolerance produce one deterministic level with the agreed owner label.
  • After a chart reload, the active set reconstructed from confirmed data matches the prior state.

Negative acceptance cases

  • An unconfirmed source pivot never appears on historical lower-timeframe bars.
  • With close-based invalidation, a wick through resistance does not mark it broken.
  • An event that already fired does not alert again until the approved re-arm rule occurs.

Phase-1 boundary

A Phase-1 specification delivers the frozen rule set, input list, event/state matrix, chart acceptance annotations, feasibility limits and a Phase-2 implementation quote. Unless explicitly quoted, it does not include a finished indicator, strategy optimization, guaranteed trading results, protected-code reconstruction or broker execution.

Have a chart idea?

Send one positive and one negative chart example for a bounded quote.

Email the brief