Pine Script Webhook Alert for PickMyTrade
Builds the PickMyTrade webhook JSON in Pine so TradingView alerts can auto-trade Apex, Tradeify, and Bulenox accounts.
//@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— your PickMyTrade account token from the dashboard. No default.qty— contract quantity sent in the payload and used for the entry. Default 1.
How to use
- Generate an alert template in your PickMyTrade dashboard first and mirror its exact field names in
buildMsg. - 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 your account token, the symbol, side, and quantity — this snippet builds it at runtime. Field names must match the alert template your PickMyTrade dashboard generates, so copy the template from the dashboard and mirror its keys if they differ from the defaults here.
Can I automate Apex with Pine Script?
Yes. PickMyTrade forwards TradingView webhook alerts to Rithmic and Tradovate accounts, including Apex evals and PAs, and also supports firms like Tradeify and Bulenox. 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. Instant delivery from $50.
View Plans — From $50