TradingView: How to send "close" correctly

Created by Levi Dane, Modified on Tue, 30 Dec, 2025 at 5:30 AM by Levi Dane

Quick answer

To close, send an explicit close action:

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

Symptoms

  • Entries work, but closes don’t
  • TradingView placeholder {{strategy.order.action}} sends only buy/sell (not close)

Most common causes

  • Using {{strategy.order.action}} expecting it to output "close"
  • Webhook messages don’t differentiate entry vs exit

Fix steps

1) Use an explicit close message

In your alert message:

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

2) If using a Pine strategy, use alert_message=

Build the JSON yourself in Pine (recommended for exits), and set TradingView alert message to:

  • {{strategy.order.alert_message}}

Verify it worked

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

This article is auto-synced from the Danetrades Copier knowledge base. If something is outdated, please contact support.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article