Skip to main content
The opening policy and termination target answer different questions. Opening policy controls whether a new position may coexist with earlier work. A termination target selects which existing work an exit may affect. Neither turns Pine’s local state into execution evidence.

Three explicit termination targets

OPEN and MODIFY always address position. Group targeting is termination-only. Omitting a position reference never silently means all positions. Ordinary EXIT offers strategy or market; an exact prior lifecycle reference requires Pine or an external controller. Market means the exact linked account plus canonical instrument, not every BTC symbol, all venues, all subaccounts or the entire portfolio. It selects Liftx-managed positions, not arbitrary exchange positions outside Liftx ownership.

New lifecycle, same running strategy

For canonical Pine commands, use these identities consistently: A cycle can be:
Include the exact instrument in custom command IDs and lifecycle references so two markets cannot reuse an identity. Generated Pine scripts use a bounded base64url instrument component for this purpose. The key remains the same. Cycle B uses a new reference and start time. No Liftx position UUID is required in the Pine signal; position_id is not accepted as a TradingView target. Do not reuse a lifecycle reference to reopen a position. Termination fences that reference against further trading signals, including while termination is still pending. A delayed message for cycle A cannot select cycle B by sharing a market name.

Group termination captures a finite set

Group admission saves the original intent and its selected targets together. Each child follows the normal position-termination path and has its own receipt.
  • At most 64 targets are captured in one group.
  • A group exceeding this bound or available queue capacity fails as a whole; it is not silently truncated.
  • An identical retry refers to the same captured set, not a newly expanded list.
  • Zero matching targets is a valid accepted result and can still advance the source’s ordering fence.
  • Positions opened after capture are outside the group. The command is not a permanent market pause.
  • Child outcomes can differ; inspect View targets in Events. Group admission is not atomic exchange execution.
A strategy group selects eligible own references earlier than its sequence. A market group must be newer than its own source-and-instrument watermark; independent strategies have independent sequence spaces, so their sequence numbers are not compared as one global clock.

Late OPEN protection

Each source maintains a separate durable fence per instrument for unseen OPEN messages. At most 1,024 distinct instrument fences are retained per setup. Admitted OPEN and termination signals advance it, including a termination group with no targets. An unseen older OPEN cannot arrive later and reopen work behind that fence. An exact close for a known older position can still follow a newer position’s open, subject to that lifecycle’s own ordering. This allows multiple-position strategies to close one older cycle without pretending all cycles share a position reference. Ordering is not a request to replay missed commands. Sequence gaps do not cause Liftx to synthesize trades.

Single and multiple opening policies

One position per instrument checks known active canonical positions, resident candidates and pending or uncertain work owned by this setup on that exact instrument. If evidence is incomplete, admission fails rather than assuming it is safe. The check is not an exchange-wide guarantee against another strategy, a later fill or later reactivation. Multiple concurrent positions permits distinct lifecycles. A configured quantity cap applies independently to each, so ten positions each below the cap can have ten times one position’s quantity. An external risk controller is needed for a portfolio-wide budget. An emitted EXIT does not clear either policy. A subsequent OPEN can still be rejected until the earlier lifecycle is complete. Pine has no callback that proves readiness and does not automatically queue a rejected entry.

Ownership scenarios

A new exit-only setup owns no positions initially. Selecting strategy will not discover positions opened by another key’s independent setup. Credential rotation within the same integration retains the namespace; a new integration does not inherit it.

Cancel versus close

Canonical TradingView commands accept terminate, and normalize cancel and close to the same termination operation. Ordinary JSON uses terminate only. Termination cancels pending work and closes remaining exposure. A pending position may need only cancellation; a partially filled position may also need closure. cancel does not promise to keep existing exposure. For a targeted OPEN-row amendment without terminating the position, use the direct API modification contract with current state.

SLx Activation on the progress bar

A always means Activation. It is hollow before SLx activates and filled afterward. The separate SLx dot shows the stop price; activation alone is not an exit.
  • SLx P&L Activation shows the current P&L activation threshold before price activation and while Set SL at breakeven is enabled. Execution economics can move this threshold after activation.
  • With price trailing active, SLx Activation follows the latest published trailing high (long) or low (short). The stop may stay unchanged until the configured minimum step is met.
  • With TP trailing, SLx Activation represents the configured count of distinct TP levels with a fill. Before activation, a planned price is only a visual reference. Afterward, it uses the canonical executed reference: the required milestone with Trail SL each TP off, or the current SLx milestone with it on. Partial fills count once per level. This is a current milestone reference, not a receipt of the original activation event.
The scale includes A even beyond the last TP. Nearby marks share a tooltip with all prices. An unavailable reference stays unpriced; no market-price estimate replaces it. Published trailing references need not update on every price tick.

SLx and stop-loss economics

With trailing by trigger price, P&L to activate trailing uses total position P&L divided by executed entry cost, including realized partial exits. It is not a price offset or a leveraged return. Indent from breakeven is a favorable price distance from current whole-position breakeven. Zero indent targets zero modeled P&L, including actual signed fees, settled funding and an estimated taker fee to close the remaining exposure. Forecast funding is excluded. Before an entry fills, these previews use the first intended entry and estimated fees. Breakeven mode follows updated economics after fills, even when that loosens the stop, until the exit triggers. Price trailing retains its ratchet, and an already-triggered exit continues independently of later repricing. SLx targets round up to the venue tick for longs and down for shorts. A configuration that places its stop beyond the requested activation is rejected. With Trailing SL by executed TP, the selected TP number is an execution milestone: Take Profit N requires fills in N distinct TP levels. A partial fill counts, but repeated fills or replacements of the same level do not count as additional levels. Touching a TP price, triggering a virtual TP or submitting an order does not satisfy the milestone. Until it is reached, SLx is inactive; its stored breakeven target does not authorize an exit. The first configured milestone activates SLx at whole-position breakeven. With Trail SL each TP disabled, the stop remains at recalculated breakeven. With it enabled, later milestones move the stop to the preceding filled TP level’s average execution price in ladder order, rather than the most recently filled level’s price. For a TP1 trigger, TP1’s first fill activates breakeven, a fill at TP2 moves the stop to TP1’s average execution price, and a fill at TP3 moves it to TP2’s average execution price. Actual exit P&L can differ because of slippage, final fees and subsequent funding. Ordinary SL Risk estimates the total position loss at the selected stop; a negative value means protected profit. Its From position / From average reference and entry-distance strategy remain distinct from SLx. TP percentages remain price offsets from entry-fee-aware breakeven. Actual execution, slippage and final fees can differ from every preview. Missing execution or fee evidence stays unavailable.