Services and resources

Free Pine v6 state-definition guide

Pine Script Partial Exit and Alert Requirements Checklist

The quantity-basis, tier-order, bar-timing and duplicate-event decisions needed before partial exits and TradingView alerts can be repaired or implemented safely.

The checklist

  1. 1

    Freeze the quantity basis

    State whether every percentage applies to the initial position or to the quantity remaining immediately before that tier.

  2. 2

    Write the tier sequence

    List each trigger and percentage in execution order, including whether a later tier is allowed when an earlier one never fired.

  3. 3

    Validate the percentage model

    Initial-position percentages must not exceed 100% in total. Remaining-quantity percentages must be evaluated as state transitions, not added together.

  4. 4

    Define quantity rounding

    Document the instrument quantity step, minimum tradable amount and whether every tier rounds down, to nearest or fails when the remainder is too small.

  5. 5

    Resolve same-bar collisions

    Specify what happens if price crosses two or more tier levels within the same forming or completed bar.

  6. 6

    Choose the bar timing

    Choose intrabar or confirmed-bar evaluation and state whether historical reload is expected to reproduce the realtime event sequence.

  7. 7

    Enforce one event per tier

    Give every tier a persistent fired state so price oscillation, recalculation or repeated alert evaluation cannot emit the same exit twice.

  8. 8

    Define reset behaviour

    State exactly when tier state resets: a new entry, a complete close, a direction change or another explicit lifecycle event.

  9. 9

    Separate strategy state from transport

    Freeze the intended quantity transition independently from webhook URLs, connector syntax, credentials and downstream broker behavior.

  10. 10

    Map the alert payload

    List the non-secret fields that identify symbol, side, tier, requested quantity basis, event ID and bar timestamp.

  11. 11

    Supply positive and negative fixtures

    Provide one exact quantity walk-through plus cases where a tier must stay silent, duplicate events are rejected and invalid percentages fail explicitly.

  12. 12

    Separate audit from repair

    Agree whether the first milestone ends with a frozen state table and defect report or includes a separately priced source change and retest.

Common questions

Do 50%, 33% and 25% exits close 108% of the position?

Only if all three are defined against the initial position, which is invalid. Against the remaining quantity, a 100-unit example closes 50, then 16.5, then 8.375 units and leaves 25.125.

Does confirmed-bar timing guarantee that an alert can never differ from a chart?

No. It removes one important intrabar ambiguity, but alert snapshots, higher-timeframe requests, data revisions and downstream transport still need their own acceptance evidence.

Is a code repair included in the requirements audit?

No. The audit freezes the state model, fixtures and repair boundary first. An authorized-source modification is quoted separately after the defect is reproducible.

Free diagnostic resource

Inspect the Pine Partial Exit State Inspector

See the public Pine v6 fixture, its 100 → 50 → 33.5 → 25.125 state walk-through and the limits of the current evidence.

Open the free tool

Ready for a feasibility check?

Pine Partial Exit Audit — 49 USD

Review the service