Pine Script Webhook Alert for PickMyTrade
Example of building a webhook JSON message in Pine for PickMyTrade; confirm field names against the message your dashboard generates.
//@version=6
strategy("PickMyTrade Webhook", overlay=true, calc_on_every_tick=false)
// ── Inputs ──────────────────────────────────────────────
pmtToken = input.string("YOUR_PICKMYTRADE_TOKEN", "PickMyTrade Token")
qty = input.int(1, "Contracts", minval=1)
// ── PickMyTrade JSON payload (built at runtime) ──────────
// Mirror the exact field names from your PickMyTrade alert
// template if they differ from these defaults.
buildMsg(side) =>
'{"symbol": "' + syminfo.ticker + '", "data": "' + side + '", "quantity": ' + str.tostring(qty) + ', "token": "' + pmtToken + '"}'
// ── Entry logic (replace with your own conditions) ───────
longCondition = ta.crossover(ta.ema(close, 9), ta.ema(close, 21))
shortCondition = ta.crossunder(ta.ema(close, 9), ta.ema(close, 21))
if longCondition
strategy.entry("Long", strategy.long, qty=qty)
alert(buildMsg("buy"), alert.freq_once_per_bar_close)
if shortCondition
strategy.entry("Short", strategy.short, qty=qty)
alert(buildMsg("sell"), alert.freq_once_per_bar_close)
Settings
pmtToken— the token or identifier from your PickMyTrade dashboard, if your generated message uses one. No default.qty— contract quantity sent in the payload and used for the entry. Default 1.
How to use
- Generate the alert in your PickMyTrade dashboard first. Its documentation says to use the generated JSON unedited, so treat
buildMsgas an example and match its field names to the generated message. - Replace the EMA-crossover placeholder with your own entry conditions.
- Create one alert with "Order fills and alert() function calls" and paste the PickMyTrade webhook URL.
- Per-firm routing (Apex, Tradeify, Bulenox) is configured on the PickMyTrade side, not in Pine — see the PickMyTrade Apex setup guide.
Frequently Asked Questions
What webhook format does PickMyTrade use?
A JSON object carrying the symbol, side and size. PickMyTrade's own dashboard generates the exact message for your account, and its documentation says to use that generated JSON unedited. This snippet shows the general shape of a Pine-built payload as an example only, so confirm every field name against the template your dashboard generates before using it.
Can I automate Apex with Pine Script?
Yes. PickMyTrade forwards TradingView webhook alerts to Tradovate accounts, including Apex evals and PAs. Other brokers, such as Rithmic, connect through its separate pickmytrade.io site. Check PickMyTrade's pages for the current list of supported firms and brokers. You stay responsible for monitoring the system and staying inside firm rules; the kill switch and max trades snippets exist for exactly that reason.
Related
Want a complete eval-ready strategy wired for PickMyTrade?
This snippet is a building block. Our paid scripts are complete strategies — entries, safety rules, and webhook alerts ready for PickMyTrade or TradersPost, tested on 3 years of MES/NQ data. Invite-only on TradingView, from $24/mo.
View Plans — From $24/mo