Strategy testing and trading software · Germanycontact@stratcorealpha.com · DE
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 — Written decision after contact

Review the service

Trading risk disclosure

Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing one's financial security or lifestyle. Only risk capital should be used for trading, and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical performance disclosure

Hypothetical performance results have many inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. There are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical results are generally prepared with the benefit of hindsight, do not involve financial risk, and cannot completely account for the impact of financial risk in actual trading. Market conditions, the ability to withstand losses, and adherence to a trading program can all materially affect actual results.

NinjaTrader trademark disclosure

NinjaTrader® is a registered trademark of NinjaTrader Group, LLC. No NinjaTrader company has any affiliation with the owner, developer, or provider of the products or services described herein, or any interest, ownership or otherwise, in any such product or service, or endorses, recommends or approves any such product or service.

Testimonials, when shown, may not represent the experience of other clients and are not a guarantee of future performance or success. Virtual-currency trading carries additional risks. See the CFTC customer advisories. Read the full financial risk disclaimer.