Skip to main content
Advanced senders use the same durable command model as the API. The TradingView envelope adds its restricted token and setup-bound source information. Send exactly one command or alert; they are distinct authoring formats for the same trading owners.
Examples use synthetic identifiers, an invalid key and fixed illustrative timestamps. They describe shape and must not be replayed as current events. Generate live times and use the private values from Liftx. Execution remains gated by availability.

Guided OPEN

Guided OPEN omits request because Liftx saved it during setup. Advanced OPEN adds the complete canonical request below. Do not send a second order model based on TradingView’s broker-emulator fields.

Advanced OPEN with OPEN, SL, SLx and TP

This illustrative derivative request uses base-asset quantity, one limit OPEN, a rearranged SL, price-trigger SLx and a rearranged TP. The complete payload is intentionally nonoperational. Export a valid draft for the selected account and catalog instrument instead of assuming the shown prices, limits or combination fit a venue.
The nested numeric action: 1 is part of PositionRequest; it is distinct from the outer command’s string action. position_side: 1 selects long; 2 selects short where the account and adapter support it. Spot, perpetual, dated or inverse execution comes from the canonical instrument, not a client spot/futures switch. The exact field rules, SLx alternatives, TP weight conventions and array pairing live in PositionRequest. OPEN/TP grids and rearrangement examples are in protections and grids. Preserve the builder’s exported TP weights; a single-row full-TP value and grid percentages must not be reinterpreted as interchangeable raw percentages.

Exact termination

Reuse the lifecycle reference and immutable start, increment the sequence, allocate a new command ID and omit request:
For a strategy group, change target to strategy and omit both client_position_id and position_started_at. For a market group, use market only with its explicit permission. Group commands also omit request. See frozen group membership.

Modification: full current state, one exact position

Advanced modify requires modify scope, the exact lifecycle reference, a fresh intent ID and sequence, and a complete canonical request. If supplied, outer expected_revision must match the current owner revision. Direct API modification requires that revision. The safe preparation sequence is:
  1. An API controller reads get-for-modification and current position state.
  2. It maps that position publication into the complete PositionRequest, retaining current rows, slot identities and immutable fields. The read response is not itself a ready-to-submit request.
  3. It changes only the intended supported protection configuration. TradingView capped modification must preserve every OPEN row, including exact slot identities; same-size replacements still count as OPEN changes.
  4. It emits an exact-position modify intent with the resulting complete request and, preferably, the observed revision.
  5. It follows the receipt and resulting state. A conflict requires a fresh read and a deliberate new intent; an uncertain outcome requires review, not whole-request replay.
Pine cannot perform step 1 or consume execution results. Therefore the supplied examples do not schedule automatic modify calls. A historical OPEN JSON is unsafe after fills, manual edits or slot-generation changes. Use the direct API for OPEN-order changes. Never broadcast one full modification request to a heterogeneous group of positions.

Envelope rules

Use integer Unix seconds for times and decimal coefficient strings for money. Strict decoding rejects unknown keys, duplicate keys, incorrect casing, trailing JSON, oversized bodies and invalid unions. One body is limited to 256 KiB. The token authenticates admission and is not part of the persisted command payload. Identical retries return the original receipt; the same identity with changed content conflicts. Receipt evidence is explained in delivery and troubleshooting.