token and setup-bound source information. Send exactly one command or alert; they are distinct authoring formats for the same trading owners.
Guided OPEN
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 static SL, price-trigger SLx and a static virtual-limit 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.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 omitrequest:
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 canonicalrequest. If supplied, outer expected_revision must match the current owner revision. Direct API modification requires that revision.
The safe preparation sequence is:
- An API controller reads get-for-modification and current position state.
- 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. - It changes only the intended supported protection configuration. TradingView protection-only modification must preserve every OPEN row, including exact slot identities; same-size replacements still count as OPEN changes.
- It emits an exact-position
modifyintent with the resulting complete request and, preferably, the observed revision. - 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.
Illustrated protection modification
The following belongs to the same synthetic lifecycle above only if a fresh API read confirms revision7, exactly these OPEN/TP rows and slot identities, and eligibility for the illustrated stop change. It changes the SL to 69,300, disables SLx and preserves OPEN/TP identity; it does not amend OPEN orders. An API controller must construct it from current state. Pine cannot fetch the prerequisite snapshot, so this is a wire example rather than an autonomous Pine modification recipe.
Envelope rules
The outertoken is required. Exactly one of command or the ordinary alert format is required. The table below applies inside command. Conditional fields must match both the action and target; optional fields are omitted when inapplicable.
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.