OPEN-SOURCE SCRIPT

Close All Positions

33
Close All Positions is a lightweight, time‑based exit tool for TradingView. Add it to any chart and tell it exactly when (hour + minute + timezone) you want every open position on that symbol closed. When the clock matches your settings, the script:

1. Fires a one‑time alert with your custom message (perfect for routing to a broker via webhook).
2. Drops a ▼ label on the bar where the exit signal occurred, time‑stamped in the tooltip for easy verification.

Key settings
Time: Choose any hour (1‑24) and minute (0‑59) for the exit trigger.
Timezone: Select the reference zone (e.g., UTC‑5) so your end‑of‑day lines up regardless of chart or broker time.
Alert Message: Type the text you want sent in the alert payload—add JSON if a webhook needs extra fields.

Typical use‑cases
End‑of‑Day Flat: Force‑exit intraday trades before the market closes.
Funding Avoidance (Crypto): Close positions just before the funding snapshot.
Risk Controls: Mandate flat exposure at a scheduled portfolio review time.

Tips
For minute‑level precision, run the indicator on a 1‑minute chart. On higher timeframes, the alert fires on the first bar that envelops your chosen minute.

Apply the script to every symbol you trade (or use a multi‑symbol alert group) if you need a blanket portfolio shutdown.

Pair it with a broker integration (TradersPost, etc.) so the alert automatically submits market‑close orders—no manual clicks required.

That’s it! Drop Close All Positions on the chart, set the clock, and let it take the “did I remember to close?” worry off your plate.

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。