alert(). They are not broker-emulator strategies, and their local plots do not represent exchange exposure.
Choose a complete example
The same running continuous alert can reuse one key for successive cycles. Multiple-position policy plus a group exit can allow concurrent independent entries. A fresh key is not required for every position.
The public examples contain an invalid token, a synthetic target and an intentionally expired credential timestamp. Use the complete script generated privately by Liftx for your real setup. The public code is an inspectable example, not a preconfigured trading connection.
Liftx generation controls
After creating the setup, select Pine (advanced) in the one-time panel. Pine example selects the code template. On a termination signal chooses an authorized selector:- One strategy position: exact locally retained lifecycle reference.
- This strategy’s positions: eligible positions belonging to this setup on its fixed market.
- All positions in this market: the explicitly granted market target, including manual and other strategies’ matching positions.
TradingView setup, step by step
- Open TradingView Supercharts and select a chart with realtime updates. Confirm its data is appropriate for the intended signal; execution remains pinned to the Liftx setup.
- Open Pine Editor, create a new indicator and replace its contents with the complete generated Pine v6 script.
- Save it privately. The code contains the restricted key; never publish it, share its source or include it in a screenshot.
- Add the indicator to the chart and open its Settings → Inputs.
- Leave its enable checkbox off while execution is unavailable. Once activation is available, set the future times and conditions described below, then enable it before creating the server alert.
- Create one alert with the condition matching the indicator title and Any alert() function call.
- In Notifications, enable Webhook URL and paste
https://hooks.liftx.io/v1/tradingview/events. - Set alert expiration within the key lifetime. For One-shot, it must also be after TERMINATE time.
- Create the alert before its future start/open time. Verify the alert’s saved configuration and running status.
- Observe the first deliberate demo event in the TradingView log, Liftx Activity and actual positions/orders.
Input reference
Continuous and Exit-only require standard time-based candles of at least one minute. Their timestamp and one-event-per-confirmed-bar logic are designed around that constraint. One-shot is driven by incoming realtime updates, not a wall-clock scheduler.
Customize conditions, preserve the protocol
In the continuous example, these are the demonstration conditions:Configure OPEN and protections
Guided mode keepsliftxOpenRequest empty: the saved setup supplies the full request. Advanced mode embeds the complete imported request as JSON text. That request can include OPEN grids, SL, SLx, TP and rearrangement using the canonical fields.
If writing dynamic price/quantity code, explicitly produce coefficient strings and scales using the instrument’s precision. Maintain all required paired arrays and conditional fields. Do not insert floating-point JSON numbers or raw chart decimal text into atomic strings. Keep the nested scope identical to the outer command and key.
Liftx owns protection execution after handoff. Pine should not try to mirror each exchange fill or independently implement SLx execution by assuming its local signal state matches the exchange.
Modify requires current state
The reusableliftxMessage function accepts modify and a complete request. That does not make a cached request safe. A controller must read current canonical position data, map it to the current request with exact slot identities, and preserve OPEN rows. Pine cannot retrieve that state or consume a webhook receipt. Use API modification for changes requiring those observations; the supplied scripts intentionally do not schedule modification.
Restart and expiry behavior
varip tracks local signal state across realtime updates, not a durable Liftx execution ledger. The examples fail closed when restarted after their required future start. They do not recover prior references or rearm themselves.
After an interruption, stop the old alert, inspect Activity and real positions, and manage outstanding exposure. Create a new setup/source for a new producer. Do not share one key between a Pine alert, an ordinary OPEN/EXIT pair and another independent strategy.
Key expiry stops new signals in the helpers. Missing data, stopped alerts or failed webhook delivery can also prevent an exit. Existing Liftx protections continue, but an emitted exit or expired key never proves the position is flat.