TradingView

Close signals and alert-message setup

Entries are usually easier than closes. The common failure is assuming TradingView placeholders will output a distinct close action when they often only return buy or sell. The safer path is to send close signals explicitly.

Use an explicit close action

{"action":"close","ticker":"EURUSD"}

That removes ambiguity and makes testing much easier than relying on placeholders that do not clearly express exits.

When to use strategy.order.alert_message

The current TradingView builder favors {{strategy.order.alert_message}} as the best quick setup path when your Pine logic already constructs the JSON you want to send. That is especially useful for exits and more complex alert logic.

How to verify

  1. Open a small test position.
  2. Trigger a close alert.
  3. Confirm the receiver closes and Logs show the close event clearly.