Use Custom scripted alerts if you want your Pine Script to send its own trading messages, including stop-loss and take-profit prices. One compatible script can send different actions through one TradingView alert. You do not need a separate alert for each action.
Adapt your script using AI
- Add a TradingView source in DaneTrades and choose Custom scripted alerts. Enter the exact chart symbol.
- Open your Pine Script in TradingView's Pine Editor. In DaneTrades, select Copy AI prompt under Prepare your Pine Script.
- Paste the prompt into your chosen AI assistant along with your existing script and chart symbol. Ask it to preserve your trading logic. Never share your private webhook URL, account credentials or API tokens.
- Review the adapted script, compile it in Pine Editor and add it to the chart. Check that it still behaves as intended. If the conversion is ambiguous or unsupported, do not enable live alerts.
Already have a compatible script? Skip the AI step. DaneTrades does not run or verify your Pine Script for you, and successful compilation does not prove alert delivery or broker execution.
Create one alert and activate
Choose the compatible script as the alert condition and select alert() function calls only (not strategy order fills as well). The script supplies the message automatically; do not paste static example JSON into the Message field. Keep alerts disabled until the receiver, symbol mapping and sizing are saved and reviewed. Activate with no open source position, manage any existing broker positions, then add the live URL under Notifications → Webhook URL and enable the alert only when ready.
Technical reference for script authors
Use the current in-app prompt as the contract reference. Send one JSON object per actual live action using protocol explicit_v1.
| Field | Required value |
|---|---|
v, mode |
Integer 1, string explicit_v1. |
symbol |
Exact configured exchange-qualified symbol, such as OANDA:XAUUSD. |
event_time |
Actual event time in UTC ISO 8601, ending in Z or +00:00. |
event_id |
Unique stable ID for each event; reuse the same ID and payload for a genuine retransmission. |
position_id |
Unique ID for this position lifetime; never reuse it for another position. |
sequence |
Integer 0 for open, then increase by exactly 1 for every later action on that position. |
action, side |
open, close, partial_close or modify; buy or sell is the position direction, including on closes. |
quantity_lots |
Required on open and partial close only; positive decimal lots, not contracts. |
price |
Optional positive source price; required for risk-based opening size. |
sl, tp |
Optional positive prices on open or modify. Modify must include at least one; null removes that level on modify only. Omit unrelated fields. |
Keep identifiers printable, nonempty and at most 128 characters, with no surrounding whitespace or curly braces. The message must be a single JSON object within 16 KiB. No duplicate keys or unknown fields. Use positive finite decimal values (canonical decimal representation at most 32 characters). DaneTrades also checks sequence, timestamps and the position history. Do not invent data, send historical events, reuse IDs for different actions, or treat an opposite entry as a close.
Illustrative opening message only. Do not paste or send this static example to a live URL.
{"v":1,"mode":"explicit_v1","symbol":"OANDA:XAUUSD","event_time":"2026-11-29T10:00:00Z","event_id":"example-event-0001","position_id":"example-position-0001","sequence":0,"action":"open","side":"buy","quantity_lots":"0.10"}
Your script must generate real values dynamically. Paid Risk (%) and Risk ($) require actual source entry price and stop loss on each open. Broker protection depends on settings and acceptance; verify it on the broker account. See compatibility and limitations.