Order Behavior
Exactly what each action does on your account, depending on the position you already hold and your subscription's settings.
On this page
Every signal is planned against the position your broker reports for that ticker at that moment. The tables below show what is sent for each action.
buy and sell
buy is bullish and sell is bearish.
| You hold | Signal | What is sent |
|---|---|---|
| Nothing | buy |
Buy to open a long. |
| Nothing | sell |
Sell short to open a short (not for crypto, which is long only). |
| Long | buy |
Adds to the long, if Allow add to position is on. Otherwise skipped. |
| Long | sell |
Sells to close the long. With Allow side swapping on, a short is then opened. |
| Short | buy |
Buys to cover the short. With side swapping on, a long is then opened. |
| Short | sell |
Adds to the short, if Allow add to position is on. Otherwise skipped. |
When the subscription trades Long only or Short only, a signal for the allowed side closes the other side first and then enters. With Sides isolated on, a position on the side you don't trade is never touched, and the trade is refused instead.
Flipping sides
When a signal closes one side and opens the other, the entry waits until the exit has filled. If the exit hasn't filled within the exit order fill wait time (120 seconds by default), the entry is not sent. That way you never hold both sides at once. The exit order stays open at the broker.
With Subtract exit quantity from signal quantity on, the signal's quantity covers both legs: long 5, sell with quantity 10 → sell 5 to close, then short 5. This matches what TradingView strategies send when they reverse.
exit
| You hold | What is sent |
|---|---|
| Long or short, no quantity sent | Closes the whole position. |
| Long or short, quantity smaller than the position | Closes that many (a partial exit). |
| Long or short, quantity equal or larger | Closes the whole position. |
| Nothing | Skipped: no position to exit. |
"quantityType": "percent_of_position" closes a percent: 50 closes half.
sentiment
sentiment says where the position should be after the trade. It works with buy, sell and resize.
flat: close the position and never open the other side.sell+flatcloses a long;buy+flatcloses a short. The full position is closed, whatever quantity is sent.long/bullishwith asell, orshort/bearishwith abuy: a partial reduce that stays on the same side. Send the quantity to reduce by.
TradingView strategies send {{strategy.market_position}} here, so a strategy's exits arrive as flat.
add
Adds to the open position, whatever Allow add to position says. If there's no position, it's skipped.
cancel
Cancels open orders on the ticker. With cancelOrderType, only orders of that type are cancelled (for example only the stop loss).
reverse
Closes the open position and opens the same size on the other side, waiting for the exit to fill first. With no position, it's skipped. On crypto the long is closed and no short is opened.
breakeven
Moves your stop to breakeven: places a stop order for the whole position at your average entry price, plus the breakeven offset for a long (minus for a short). The signal must send "orderType": "stop" or "stop_limit". Send it with "cancel": true to replace the old stop.
{
"ticker": "MNQZ2026",
"action": "breakeven",
"orderType": "stop",
"breakevenOffset": 2,
"cancel": true
}
resize
Sets the position to an exact size. quantity is the size to end at, and 0 closes everything. The difference is bought or sold, and the position never crosses zero to the other side. sentiment guards the direction: long allows buys, short allows sells, flat only moves toward zero.
Cancelling open orders first
With Cancel open orders before new ones on (or "cancel": true in the signal), every open order on the ticker is cancelled before the exit or entry. The broker must confirm the cancels within the cancel wait time, or nothing else is sent. A same-side add doesn't cancel (unless the signal sends "cancel": true), so your existing take profit and stop loss stay in place.
Take profit and stop loss can block an exit
If your entries carry a take profit or stop loss and you also send exit signals, some brokers reject the exit while those orders are open. Turn cancelling on, or send "cancel": true with your exits.
Prices
- Market orders are sent without a price.
- Limit orders use
limitPrice, then the signal'sprice. If neither is sent, a quote is read at the subscription's market price type (midpoint by default). - Stop orders use
stopPricein the same way. - Prices are rounded to the instrument's tick size: buys round down and sells round up, so the order is never worse than you asked.
Signals sent at the same time
Signals for the same ticker on the same account run one at a time, in the order they arrived (trade locking). Even so, an alert sent a moment after another can see a position that hasn't filled yet. Leave a few seconds between an exit and the next entry, or send one signal that does both (a flip).
↑ ↓ to move · Enter to open · Esc to close