Ctrl+V to paste · drag & drop · or 📁 Upload
Pick what you want — the JSON builds below to copy into your alert's Message box. Any value can be a fixed number OR a TradingView placeholder your strategy fills — e.g. {{close}} for a price, {{plot("SL")}} for a plotted stop. Rules like risk % and pip stops are usually fixed; prices usually come from the strategy.
{}
alert() call with your variablesPut this inside your strategy/indicator's Pine code. Every value you typed becomes one of your variables, wrapped in str.tostring(...) — e.g. entry price → str.tostring(entryPrice), stop → str.tostring(slPrice), size → str.tostring(lots). These are suggested names — rename them to match the variables your strategy actually computes.
alert('{}', alert.freq_once_per_bar_close)
Every account connected to TradeBench — MT5 (forex) and IBKR (stocks) — with live status, balance and execution state. Manage → opens that broker's setup.
Read the reference below, then let the builder assemble a valid message for you.
One JSON message goes in the TradingView alert's Message box — the action decides what happens. Include only the fields that action needs.
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| open | Places a new order | + side, a size, optional stop/target | "action":"open" |
| closelong | Closes all longs on the symbol | + symbol — no ticket | "action":"closelong","symbol":"EURUSD" |
| closeshort | Closes all shorts on the symbol | + symbol | "action":"closeshort","symbol":"EURUSD" |
| closeall | Closes everything on the symbol (both sides) | + symbol | "action":"closeall","symbol":"EURUSD" |
| closelongshort | Closes both directions' positions (leaves pendings) | + symbol | "action":"closelongshort","symbol":"EURUSD" |
| closelongpct / closeshortpct | Partial close — % of each position | + symbol + close_pct (1-100) | "action":"closelongpct","symbol":"EURUSD","close_pct":50 |
| closelongvol / closeshortvol | Partial close — a lot amount off the direction | + symbol + close_lots | "action":"closelongvol","symbol":"EURUSD","close_lots":0.20 |
| cancellong | Cancels all pending buy orders on the symbol | + symbol | "action":"cancellong","symbol":"EURUSD" |
| cancelshort | Cancels all pending sell orders on the symbol | + symbol | "action":"cancelshort","symbol":"EURUSD" |
| modifylong | Sets SL/TP on all open longs on the symbol | + symbol + a stop/target (any unit) | "action":"modifylong","symbol":"EURUSD","sl_price":1.08 |
| modifyshort | Sets SL/TP on all open shorts on the symbol | + symbol + a stop/target | "action":"modifyshort","symbol":"EURUSD","tp_pips":30 |
| newsltpbuystop · newsltpbuylimit · newsltpsellstop · newsltpselllimit | Sets SL/TP on pending orders of that type | + symbol + a stop/target | "action":"newsltpbuylimit","symbol":"EURUSD","sl_pips":20 |
| alert | Logs the message, never trades | any text / JSON | "action":"alert" |
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| closelongopenshort | Close longs, then open a short | + symbol + a size (like an open) | "action":"closelongopenshort","symbol":"EURUSD","vol_lots":0.10 |
| closeshortopenlong | Close shorts, then open a long | + symbol + a size | "action":"closeshortopenlong","symbol":"EURUSD","vol_pct_eq_loss":1,"sl_pips":20 |
| closelongopenlong · closeshortopenshort | Re-enter the same side (close then re-open) | + symbol + a size | "action":"closelongopenlong","symbol":"EURUSD","vol_lots":0.10 |
| closelongshortopenlong · closelongshortopenshort | Flatten both sides, then open one | + symbol + a size | "action":"closelongshortopenlong","symbol":"EURUSD","vol_lots":0.10 |
Shorthands also work: CL+OS, CS+OL, CL+OL, CS+OS, CLS+OL, CLS+OS. The open is always a market order; the direction is set by the command name (no side needed).
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| eaoff | Halts new trades (flips Auto-execution OFF) | no symbol needed | "action":"eaoff" |
| eaon | Resumes trading (flips Auto-execution ON) | no symbol | "action":"eaon" |
| closealleaoff | Panic — closes ALL account positions, then halts | no symbol | "action":"closealleaoff" |
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| vol_lots | Fixed lot size | any open | "vol_lots":0.10 |
| vol_dollar | Risk a fixed $ amount | needs a stop; EA computes the lots | "vol_dollar":50 |
| vol_pct_eq_loss | Risk % of account equity | needs a stop | "vol_pct_eq_loss":1 |
| vol_pct_bal_loss | Risk % of account balance | needs a stop | "vol_pct_bal_loss":1 |
| vol_pct_bal_margin | Size so margin = % of balance | no stop needed | "vol_pct_bal_margin":5 |
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| sl_pips / sl_price / sl_pct | Stop loss — in pips, exact price, or % | pick one unit | "sl_pips":20 |
| tp_pips / tp_price / tp_pct | Take profit — pips, price, or % | pick one unit | "tp_pips":60 |
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| betrigger + beoffset | Move stop to breakeven after X pips profit | pips | "betrigger":10,"beoffset":1 |
| trailtrig + traildist + trailstep | Trail the stop behind price (fixed pips) | pips | "trailtrig":15,"traildist":10,"trailstep":3 |
| atrtimeframe + atrperiod + atrmultiplier + atrtrigger | Trail the stop by ATR (distance = ATR × mult) | tf string + numbers; trigger in pips (0 = at once) | "atrtimeframe":"60","atrperiod":14,"atrmultiplier":2 |
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| entry_pips / entry_pct | Pending entry as an offset from market | instead of price; limit below / stop above | "orderType":"limit","entry_pips":10 |
| spread | Skip the open if spread is wider than this | pips | "spread":2 |
| Syntax | What it does | How to use | Example |
|---|---|---|---|
| symbol | The instrument | use {{ticker}} — TradingView fills it | "symbol":"{{ticker}}" |
| side | Direction for an open | buy or sell | "side":"buy" |
| orderType | Entry type | market / limit / stop | "orderType":"limit" |
| price | Entry price | limit / stop orders only | "price":1.0820 |
| id | De-dupe key | drops a double-fired alert (15s window) | "id":"tv-{{ticker}}-{{time}}" |
| ref | Free label (shows in the Journal) | optional | "ref":"london-fvg" |
{"action":"open","symbol":"{{ticker}}","side":"buy","vol_lots":0.10,"sl_pips":20,"tp_pips":60,"id":"tv-{{ticker}}-{{time}}"}
{"action":"open","symbol":"{{ticker}}","side":"buy","vol_pct_eq_loss":1,"sl_pips":20,"betrigger":10,"beoffset":1,"trailtrig":15,"traildist":10,"trailstep":3,"id":"tv-{{ticker}}-{{time}}"}
{"action":"open","symbol":"{{ticker}}","side":"buy","orderType":"limit","price":1.0820,"vol_lots":0.10,"sl_pips":25}
closeshort / closeall too):{"action":"closelong","symbol":"{{ticker}}"}
{"action":"modifylong","symbol":"{{ticker}}","sl_price":{{close}}}
{"action":"cancellong","symbol":"{{ticker}}"}
{"action":"closelongpct","symbol":"{{ticker}}","close_pct":50}
{"action":"closelongopenshort","symbol":"{{ticker}}","vol_pct_eq_loss":1,"sl_pips":20}
{"action":"closealleaoff"}
Attach a message to each entry/exit line in your Pine strategy, then set the alert's Message to just {{strategy.order.alert_message}} — each order sends its own JSON:
strategy.entry("Long", strategy.long,
alert_message='{"action":"open","symbol":"{{ticker}}","side":"buy","vol_pct_eq_loss":1,"sl_pips":20}')
strategy.close("Long",
alert_message='{"action":"closelong","symbol":"{{ticker}}"}')
EnableWebhookExecution=true.{{ticker}} / {{close}} / {{strategy.order.action}} are TradingView placeholders — it fills them when the alert fires.OANDA:EURUSD → EURUSD); set the EA's SymbolSuffix/Prefix if your broker uses one (e.g. EURUSD.r)."id" so a double-fired alert is ignored (15-second window).
Got it? Build your message — pick an action and the JSON (plus a Pine alert() line) is generated for you.
Your MT5 accounts live here. Add an account to get its EA token + webhook URL, then install the Expert Advisor (the ⚙ Install the EA tab) so the app can show its balance & positions, feed the Live Chart, and place the orders you send — automatic (Auto Signals) and manual. It runs locally inside your MT5. Start on a demo account.
Install the EA — once per MT5 terminal. Its AuthToken is the EA token from an account's card (🖥 Accounts tab).
MarketAnalyzerSignalEA.ex5 using the button above..ex5 into that folder. Then in the Navigator (Ctrl+N) right-click Expert Advisors → Refresh.https://hook.charts-analysis.com → OK.poll … queue empty — the EA is connected. The EA status in Manual Execution turns green.DRY-RUN (no real order). To go live on demo: set EnableLiveExecution = true and switch Auto-execution ON inside Manual Execution.Tick the instruments you trade — only these appear in the dropdown. The list comes from your MT5 Market Watch (start the EA to load it); add/remove symbols there to change what's available.
Reuse a ticket later. Load fills the form so you can review the live price, then Place it; Repost sends the saved order to the EA immediately.
| User | Role | Status | Actions |
|---|
Tick the sections this user can see on their home screen. Admins always see everything regardless.
Send us a question or inquiry and we'll get back to you by email.
Categories help you organize and filter notes by topic. Click the color dot to change, or use the buttons to rename or delete.
Select one or more assignments. Their charts will be shown in a long scrollable side-by-side view.