Configure a private copy
- Create a Guided setup with OPEN and terminate and an approved small demo quantity. Save the private bundle from its Pine (advanced) tab before leaving Liftx.
- Start with the One-shot source below. Replace its synthetic connection values using that bundle: token, exact link/instrument, source UUID, binding revision, and the connection prefix used in event IDs. Set
liftxCredentialExpiresAtto the key’s expiry in Unix milliseconds, or0for no expiration. Review every replacement; changing only the token is insufficient. The setup screen supplies Continuous, while this scheduled variant is configured from the template. - Set a future OPEN time and a TERMINATE time at least 60 seconds later, before key expiry when one is set.
- Enable the indicator and create Any alert() function call before OPEN time. Keep alert expiration after TERMINATE time and no later than credential expiry when one is set.
- Observe both events in the provider log, Liftx Events and the actual position.
0 idle, 1 waiting, 2 OPEN emitted, 3 termination emitted, 4 OPEN window missed. None of these values means accepted, filled, canceled or flat.
Complete source
Download the public Pine example.Before adapting the sample
Your private copy must replace the dummytoken, link, catalog ID, source UUID, binding revision, event-ID prefix and liftxCredentialExpiresAt. The generated Continuous script’s liftxMessage function contains the matching connection values and event-ID prefix; its credential-expiry constant supplies the matching deadline. Preserve the One-shot lifecycle logic when adapting those values. Guided mode intentionally has an empty liftxOpenRequest; Liftx uses the saved opening configuration.
Retain one coordinated producer per setup and instrument, preserve event identities on delivery retries and never reuse a lifecycle reference for a new position. Pine setup, canonical command fields and target semantics explain the contract.
After any interruption, inspect Events and actual positions, manage remaining orders/exposure and create a fresh source for a new alert. The example has no execution feedback, automatic delivery retry, automatic rearm or restart recovery.