Alert payload (v2)#
HookTrader's internal vocabulary is the v2 envelope. Your mapping rules translate whatever your indicator emits into this shape. If your indicator already emits v2 (e.g. the HookTrader Signal Connector), no translation is needed.
Envelope (always required)#
| Field | Type | Notes |
|---|---|---|
v |
2 |
Schema version. Must equal 2. |
type |
string | One of entry, tp_hit, trail, move_sl, exit, custom. |
symbol |
string | e.g. BTCUSDT. TradingView's {{ticker}} works. |
ts |
int | Unix epoch ms or seconds. TradingView's {{timenow}} works. |
price |
number | Optional — current price at alert time. |
client_id |
string | Optional — idempotency key. |
Per-type payloads#
entry#
{
"v": 2,
"type": "entry",
"symbol": "{{ticker}}",
"ts": {{timenow}},
"side": "long",
"entry": {{close}},
"sl": 49000,
"tps": [51000, 52000],
"qty": 0.01
}
| Field | Required | Notes |
|---|---|---|
side |
yes | long or short. |
entry |
no | Reference price. When absent the side-check on sl/tps is skipped. |
sl |
conditional | Required unless Allow entries without SL is on. |
qty |
conditional | For qty_mode = from_indicator. |
risk_usd |
conditional | Per-trade risk in USDT (alternative to qty). |
tps |
no | Array of up to 10 TP prices in order. |
tp_hit#
One alert template covers every TP level — just vary level (1–10).
trail and move_sl#
Both carry a new stop-loss price:
trail— ratchets only: rejected if it would move the SL backward.move_sl— any direction allowed.
exit#
reason is one of sl_hit, trail_exit, manual, emergency.
custom#
name must match ^[a-z][a-z0-9_]{1,49}$ and resolve to a key in your strategy's custom-events map.
Strict mode#
Toggle settings.strict_payload on to reject any payload that's missing a required key after translation. With strict off (the default), missing-but-non-essential keys are silently tolerated where possible. The Review and activate step in the wizard shows the live-computed required-key list.
Extra fields#
Extra keys are silently ignored. You don't need to strip TradingView's standard placeholders — they just won't be used.