Connect your TradingView strategy
Hestavant works with any strategy or indicator - yours, a purchased one, or one you wrote. All it needs is a TradingView alert sent to your signal's webhook address. The message can be your strategy's own standard alert, a single word like buy or close, or Hestavant JSON for full control.
- 1
Create a signal
In the dashboard open Signals, name it after your strategy and click Create signal. You get a Webhook URL - a secret address, so keep it private. One signal per strategy is the usual set-up. You can switch on Require token for a second lock if your alerts send JSON.
- 2
No JSON? Use your strategy's own alert, or one word
A strategy, as it is. Create the alert on the strategy and leave TradingView's standard message (order buy @ 2 filled on MNQ1!. New strategy position is 2). Hestavant reads the side, the size and the new position: a buy enters long, a sell after a long reverses or exits, and position 0 closes.
Plain text. Any script or indicator can send one word per alert -
buy,sellorclose- optionally with a symbol and values:buy sell MNQ1! buy XAUUSD qty=0.5 sl=2640 tp=2680 close
These alerts carry no stop or target, so set Default stop (and optionally Default target) in points on the account's route - Hestavant places them from your own fill. With no default target, the strategy's exit signal closes the trade.
- 3
Full control: Hestavant JSON
Every alert is one JSON object. An entry looks like this:
{"action":"buy","id":"T-1042","symbol":"MNQZ2026", "price":21050.25,"sl":21030.25,"tp":21110.25}The fields:
Field When Meaning token if required Only when the signal's Require token switch is on - a second lock on top of the secret webhook address. action always buy · sell (entries) · modify (move stop / target) · partial · close · cancel id always A trade id your strategy chooses, unique per trade. Later modify / partial / close alerts use the same id. symbol entries The chart's ticker, e.g. MNQZ2026 or XAUUSD. Futures contracts become NinjaTrader names automatically (MNQZ2026 → MNQ 12-26). price entries The strategy's entry price on the chart - the reference the stop and target distances are measured from. sl · tp entries The stop and target as chart prices. Hestavant keeps their distance from price, or uses them exactly - your choice per account. side optional long or short; taken from buy / sell when left out. type optional market (default) or limit (limit uses price as the limit; NinjaTrader only). size_mode + qty · risk_pct · risk_usd optional Only used when the account's Size from is set to Alert: qty contracts/lots, or a risk % / fixed $ risk. sl · tp on modify modify The new stop and/or target as chart prices. pct partial How much of the position to close, in percent. reason optional Free text shown in your journal and activity log. The other actions:
{"action":"sell","id":"T-1043","symbol":"XAUUSD","price":2650.4,"sl":2656.4,"tp":2638.4} {"action":"modify","id":"T-1042","sl":21050.25} {"action":"partial","id":"T-1042","pct":50} {"action":"close","id":"T-1042","reason":"exit signal"} {"action":"cancel","id":"T-1044"} - 4
Make your strategy send JSON - pick the way that fits
A. Your strategy already has a JSON / webhook alert option. Some strategies build these messages for you. Choose the JSON format in its settings, paste your token where it asks for one, and go to step 4.
B. You can edit the Pine Script. Build the message with
alert()where the strategy enters, moves its stop and exits:hv(action, id, price, sl, tp) => '{"action":"' + action + '","id":"' + id + '","symbol":"' + syminfo.ticker + '","price":' + str.tostring(price) + ',"sl":' + str.tostring(sl) + ',"tp":' + str.tostring(tp) + '}' if longSignal id = "L-" + str.tostring(time) strategy.entry(id, strategy.long) alert(hv("buy", id, close, longStop, longTarget), alert.freq_once_per_bar_close)Use the same
idlater for that trade'smodify,partialandclosemessages.C. You can't edit the script (an indicator or a closed strategy). Create one alert per action and type the message yourself. TradingView fills in the placeholders:
{{ticker}},{{close}}, and{{plot("Plot name")}}for a stop or target the indicator plots.{"action":"buy","id":"{{ticker}}-{{timenow}}","symbol":"{{ticker}}", "price":{{close}},"sl":{{plot("Long Stop")}},"tp":{{plot("Long Target")}}}Without a unique id per trade, later alerts can't find the trade; a fixed id per direction (for example
"id":"long") works when only one trade is open at a time. - 5
Create the TradingView alert
On the chart click Alert. Condition: your strategy or indicator - with way B choose alert() function calls only. Under Notifications tick Webhook URL and paste your signal's address. For way C put the JSON in Message.
TradingView webhooks need a TradingView plan that includes them, and two-factor authentication on your TradingView account.
- 6
Assign accounts, check the points, test
On Accounts, assign the signal to an account and open its route. Choose Stop / target: Points from my fill keeps your strategy's distances in points and measures them from your platform's own fill, so the stop and target always sit exactly as many points away as your strategy intended; Chart prices uses the levels in the alert as they are. The route editor shows where they will land with your own numbers.
Press Test connection on the route - it checks your PC, platform, account and symbol without placing an order - then switch the route live. A first live alert on a demo account is the final check. Every alert - accepted or refused, and why - appears in the activity log.
Troubleshooting
The activity log says “not JSON”+
The alert's message is not valid JSON. Check quotes and commas, and that every placeholder resolves to a number where a number is expected.
“wrong or missing token”+
The signal has Require token on and the message does not carry its current token. Copy it again from Signals, or switch Require token off to use the webhook address alone.
“this alert has no stop”+
Plain-text and standard strategy alerts carry no stop. Set a Default stop (points) on the account's route, or send sl= in the message.
“entry needs price, sl and tp”+
Entries must carry the strategy's entry price, stop and target - Hestavant never sends an order without a protective stop.
NinjaTrader can't find the instrument+
A continuous chart such as MNQ1! has no contract month. Set the route's Instrument to the contract you trade, e.g. MNQ 12-26, or chart the dated contract.
My broker's symbol is different (MT5 / cTrader)+
Set the route's Instrument to the exact name in your platform, e.g. XAUUSDm or USTEC.