NixoraTrade

Alerts from an indicator or your own code

Naming the instruction yourself: the verbs, a message builder, and the advanced controls — partial closes, trailing stops, ATR stops and one-message reversals.

When the alert comes from an indicator, TrendSpider, or your own code, nothing on the other side knows whether you are in a trade. So you say exactly what to do. That is all this page is: how to say it.

New here? Sending messages to Nixora covers where your webhook address lives and the two switches that must be on before anything trades.

Copy one of these to start

TradingView indicatorTradingView

An indicator does not know whether you are in a trade, so you need one alert to buy and another to sell.

{"action":"open","side":"buy","symbol":"{{ticker}}","vol_lots":0.10}
TrendSpiderTrendSpider

Same message — TrendSpider fills its own placeholders before it sends.

{"action":"open","side":"buy","symbol":"%alert_symbol%","vol_lots":0.10}
Custom codePython · JS · PHP · cURL

Anything that can POST JSON works. Put your webhook address in the URL.

curl -X POST https://hook.nixoratrade.com/h/YOUR_TOKEN \
  -H "Content-Type: application/json" \
  -d '{"action":"open","side":"buy","symbol":"EURUSD","vol_lots":0.10}'

Build your own

Build your message

Choose what you want. The message updates as you type — copy it into your alert, or copy the Pine line into your script.

Paste this into the alert's Message box
…
Or put this in your script
…

Two options there are worth switching on:

The same generator, with more options, is in the app under Auto Trading → Syntax & Builder.

The shape of a message

{"action":"open","side":"buy","symbol":"EURUSD","vol_lots":0.5}

The thing to memorise: the verb is action, and the direction is a separate field, side. Opening is open plus a side; the other verbs are for closing and managing what is already there. The short forms buy and sell also work and mean exactly the same thing.

The everyday verbs

Opening

{"action":"open","side":"buy","symbol":"EURUSD","vol_lots":0.5}

To rest an order at a price instead of buying now, add orderType and price:

{"action":"open","side":"buy","symbol":"EURUSD","orderType":"limit","price":1.0750}

Getting out

{"action":"closelong","symbol":"EURUSD"}

The last two differ in one thing only: whether orders that have not filled yet are cancelled too.

Changing what is already there

{"action":"modifylong","symbol":"EURUSD","sl_price":1.0820}

Only the fields you include change. Leave tp_price out and your target stays where it is.

Stopping the account

{"action":"eaoff"}

eaoff is the one to wire to a "something is wrong" condition: it prevents new damage without closing positions you may want to handle yourself.

Beyond the basics

Everything below is optional. Skip it until you need it.

Closing part of a position

{"action":"closelongpct","symbol":"EURUSD","close_pct":50}

Watch the unit. On the pct verbs the number is a percentage: 50 is half the position, not fifty lots. Percentages travel well when one alert feeds several accounts; a fixed lot size does not.

Turning a position around in one message

{"action":"closelongopenshort","symbol":"EURUSD","vol_lots":0.5}

Read the names left to right and they say what they do. They exist as one verb so the turn is a single instruction — two separate alerts can arrive out of order and leave you the wrong way round.

Its shorthand also works: cl+ol, cl+os, cs+ol, cs+os, cls+ol, cls+os.

Coming from PineConnector

Keep your alerts and change only the webhook URL. The text form works as it is:

123456789,buy,EURUSD,vol_lots=0.5,sl_pips=20

The first field is ignored, because the secret key in your webhook URL is what identifies you. You can also leave it out:

buy,EURUSD,vol_lots=0.5,sl_pips=20

If you leave it out and your symbol is named like a command (for example BULL), the alert is refused, because two commands in a row can't be read safely. Put any first field in front: 1,buy,BULL,vol_lots=1. The verbs buy, sell, long, short, bull, bear, buylimit, buystop, selllimit, sellstop, newsltplong, newsltpshort, cancellongbuystop, cancellongbuylimit, cancelshortsellstop and cancelshortselllimit all work, in the text form and in JSON.

Four things to check:

sl=0 (move the stop to breakeven now), accfilter=, a trailtrig of 0 or less, account-wide closeall, text-form pips and a closelongpct with no percentage need MT5 EA 2.34 or MT4 EA 1.80. The account filter checks the EA's Account Filter Basis setting and skips an entry below your number. A closelongpct with no percentage uses the EA's Default Partial Close setting. Until those EAs are released these alerts are refused by name.

Placing a waiting order with its stops attached

{"action":"newsltpbuylimit","symbol":"EURUSD","price":1.0750,"sl_price":1.0700,"tp_price":1.0900}

Read the name as new · sl/tp · buy · limit. The point is that the order and its protection arrive together — an order placed first and protected afterwards is unprotected in between.

Sizing by risk instead of lots

A fixed lot size is too big on one account and trivial on another. These size to the account:

{"action":"open","side":"buy","symbol":"EURUSD","vol_pct_eq_loss":1,"sl_pips":20}

That risks 1% of equity, worked out from the stop — so it needs a stop to measure against.

Stops that manage themselves

Set these at entry and the EA runs them; no follow-up alert is needed.

{"action":"open","side":"buy","symbol":"EURUSD","vol_lots":0.5,"sl_pips":20,"betrigger":10,"beoffset":1}

That moves the stop to break-even once the trade is 10 pips up. There are trailing-stop and ATR-trailing equivalents, all listed in the Keyword reference.

On an Alpaca account

Alpaca takes the same messages, in shares and on US stocks. There is no Expert Advisor there, so NixoraTrade works out each calculated value once when the alert arrives.

{"action":"open","side":"buy","symbol":"AAPL","vol_dollar":100,"sl_pct":2,"tp_pct":4}

To change a stop or target on an open position, use modifylong or modifyshort. "sl":0 moves the stop to your average entry.

{"action":"modifylong","symbol":"AAPL","sl_pct":2}

If nothing is resting, this places one protective order for the shares you hold. If a stop is resting but no target, a target is refused, because Alpaca holds the shares on the stop. Stops belonging to a strategy subscription are left alone.

newsltpbuystop, newsltpbuylimit, newsltpsellstop and newsltpselllimit change the stop and target of resting orders from this webhook, if the order was placed with them.

Not available on Alpaca: automatic breakeven, trailing stops and ATR trailing, because something would have to watch the position after entry. These are refused, never ignored.

On a Binance account

Binance takes JSON messages only, not PineConnector's comma format. Each alert must state qty, a stop and a target, and carry the alert's time; add an id too, to name the alert. An id without a time is refused, because the age of the alert cannot be checked.

{"action":"open","side":"buy","symbol":"BTCUSDT","qty":"0.01","sl_price":"90000","tp_price":"110000","id":"a1","time":"{{timenow}}"}

Anything else from this guide, such as spread, accfilter, trailing or partial closes, is refused by name, never ignored.

Working on one specific order

Three verbs take a ticket — close, modify and cancel — and act on that one order alone.

{"action":"close","ticket":148302,"vol_lots":0.01}
{"action":"modify","ticket":148302,"sl_price":1.0820}
{"action":"cancel","ticket":148302}

A ticket is the number your broker gave that one order, so these only work on your account address — see How alerts are routed.

Writing a note instead of trading

alert records a line in the Journal and places nothing — useful for marking a session open or a change in conditions, so the Journal reads as a story rather than a list of fills.

{"action":"alert","symbol":"EURUSD","ref":"london-open"}

When something is refused

A refusal is not silence. It is recorded against the alert that caused it, with the reason in plain words, next to the accepted orders in the Journal.

The habit worth forming: when an alert does not do what you expected, read the refusal before changing the alert. It usually names the fix.

Everything in one place

Every verb and every parameter, with what it does and an example, is in the Keyword reference.