Account |
a , acc , account |
|
|
* |
Account Name(s)
(no special characters!) |
The account name of the API key to use for this command (as defined under Accounts on the left)
Multiple account names can be specified as comma separated list: a=acc1,acc2,acc3
For different exchanges/symbols per account use: a=ex1:sym1:acc1,ex2:sym2:acc2
If 'ex' or 'sym' is left empty the current defaults (first local, then ➔ General Options) are used, alternatively a=ex1:acc1,ex2:acc2 is possible!
Example:
ex=bitmex-testnet sym=xbtusd
acc=bitmex:acc1,acc2,acc3
(equals acc=bitmex:xbtusd:acc1,bitmex-testnet:xbtusd:acc2,bitmex-testnet:xbtusd:acc3 )
Note: When multiple accounts are specified, each command is repeated per account sequentially which introduces time slippage between the accounts, thus for all time critical operations the alternative option ap= should be used! (see below)
Note: Besides time slippage also conditional options (ifnone/iffound/iferror etc.) work different over multiple accounts – for "success" the command has to be successfully completed for all accounts, for "failure" just one error within all accounts is enough, thus again the alternative option ap= should be used in these cases as the control flow will be completely individual for each account!
More info about built-in market/symbol name mapping on our Wiki |
Accounts Parallel |
ap , par , parallel |
|
|
n/a |
Account Name(s)
(no special characters!) |
Similar to a= above but instead runs all commands following it in parallel for the given API keys
Note: Replacement for a= command, can only be used once per alert and in a line by itself or with new defaults (e= , s= etc.)! |
Book Side |
b , book , side |
|
|
n/a |
buy / long ; sell / short |
The side of the market this order should be placed on (for limit/market opening orders) or side to filter by (for c/ch=order and c/ch=pos )
Note: Use buy /sell for spot markets and long /short for margin – especially important when an exchange/market supports both! |
Callback Rate |
cbrate |
|
|
n/a |
<number> |
Binance Futures / OKX only: Callback rate (distance) for trailing stops (Binance: min 0.1, max 5 – where 5 = 5%)
Note: This value can be automatically calculated if you specify both so=123 (activation price) and ts=1% (trailing distance) instead! |
Cancel / Close |
c , cancel , close |
|
|
order (for cancel= ) ; pos (for close= ) |
order / position / pos
takeprofit / tp ; stoploss / sl ; ts ; so ; open / limit ; close / stops |
Cancel open orders (c=order ) or close open positions by placing a closing order (c=pos ) according to other specified parameters (see below)
Can be combined with filtering options like b , id , minpl , mins etc.
Find more info regarding filtering on our Wiki! |
Cancel / Close Maximum |
cm , maximum |
|
|
100% |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Specify how many open orders or positions should be closed (see cmo for ordering) |
Cancel / Close Maximum Order |
cmo , order |
|
|
oldest |
newest / oldest; lowest / highest; smallest / biggest; random |
Sort order for orders to be canceled (c=order ) or positions to be closed (c=pos ) |
CMC Ticker ID |
cmcid |
|
|
BTC |
<symbol> |
Specifies the CoinMarketCap ticker symbol to query for min/max price change checks (see min1h etc. below)
|
Cached Balance |
cb , bc , cachedbalance |
|
|
n/a |
0 / off / false ; 1 / on / true |
Use last cached balance info for an account if possible, otherwise current balance is queried!
Note: If specified without a value it defaults to on/true, eg. cb equals cb=1 ! |
Cached Price |
cp , pc , cachedprice |
|
|
n/a |
0 / off / false ; 1 / on / true |
Use last cached price data (ticker) for a symbol if possible, otherwise new ticker data is queried!
Note: If specified without a value it defaults to on/true, eg. cp equals cp=1 ! |
Check |
ch , check |
|
|
n/a |
order / position / pos
takeprofit / tp ; stoploss / sl ; open / limit ; close / stops |
Similar to the cancel/close command but will only check if a matching order/position exists
Can be combined with filtering options like b , id , minpl , mins etc. – best used with ifn /ifo conditionals (see below) to jump to other commands or abort the alert if matching items found (or not found)!
Find more info regarding filtering on our Wiki! |
Check for Order ID |
cid , checkid |
|
|
n/a |
Anything (excluding special characters) |
Option for c=pos to first check if any open orders match the given custom order ID(s) (same format as id= below) before placing a closing order – to specify an action or jump mark in case no order matches see option wid= further down! |
Check for Alert |
cha , checkalert , alertcheck |
|
|
n/a |
<alert> |
Checks if the given alert (by alert id or name) exists and is enabled.
If ife= or ifd= are specified as well those are processed according to the state of the alert (enabled or disabled) – otherwise the rest of the line is skipped if the alert is not found or disabled! |
Convert Balance |
convert |
|
|
n/a |
Anything (excluding special characters) |
FTX only: Convert the given list of currencies in the form of convert=from1:to1,from2:to2 in the amount specified via q= (either absolute or percentage) |
Delay |
delay , sleep , wait |
|
|
n/a |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Pauses execution between this and the previous command for the specified time in seconds (eg. delay=7.5 ) – supports different time units eg. 1.5m for 90 seconds, 2.5h for 150 minutes etc.
Note: Percentages are based on the bar time (chart resolution) of the alert! |
Disabled |
d , debug , disabled |
|
|
0 |
0 / off / false ; 1 / on / true |
Disables placement or cancelation/closing of orders/positions (read-only mode)
This is helpful for debugging by outputting the calculated parameters to be used (or to check for open orders/positions, although ch and ifn /ifo is now recommended for this!)
Note: If specified without a value it defaults to on/true, eg. disabled equals disabled=1 ! |
Disable Alert |
disable |
|
|
n/a |
<alert> ; PV / APP |
Disable given ➔ PV Alert or current running alert (if none is specified)
To disable running of any received alerts (global "pause" mode) use disable=app
Note: Alert can be specified by one of its names or by its unique ID (found under the name field of the expanded alert) – wildcards (* ) supported for alert names! |
Exchange |
e , ex , exchange |
|
|
Exchange Name from Alert |
<exchange> |
The receiving exchange for this command
Available: binance , binanceus , binanceft , binanceft-testnet , bitfinex , bitmex , bitmex-testnet , bittrex , bybit , bybit-testnet , coinbase , coinbase-sandbox , deribit , deribit-testnet , ftx , ftxus , gemini , gemini-sandbox , kraken , krakenft , krakenft-demo , kucoin , kucoin-sandbox , kucoinft , kucoinft-sandbox , oanda , oanda-sandbox , okcoin , okex , okex-demo , phemex , phemex-testnet , poloniex , simplefx , simplefx-demo
Note: When targeting multiple accounts via comma separated list in a= or ap= the exchange can be specified per account in the same way! (and in the same order as for a= / ap= )
Note: It is highly recommended to use the Symbol button (found in the alert editor and under the exchange settings) to insert exchange and symbol options conveniently and safely!
More info about built-in market/symbol name mapping on our Wiki |
Stop / Pause / Resume Alerts |
exitall , pauseall , resumeall |
|
|
n/a |
n/a |
Force-exit / pause or resume all running alerts
Note: Forcefully stopping running alerts can lead to unprotected positions! |
Enable Alert |
enable |
|
|
n/a |
<alert> ; PV / APP |
Enable given ➔ PV Alert or current running alert (if none is specified)
To enable running of any received alerts (resume from global "pause" mode) use enable=app
Note: Alert can be specified by one of its names or by its unique ID (found under the name field of the expanded alert) – wildcards (* ) supported for alert names! |
Error Handling |
err , error , iferror , onerror |
|
|
0 |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / retry / continue / <number> / <label> |
Determines what to do when the current command encounters an error – use either the listed values, their aliases or specify a custom jump label:
cancel (-7): Cancel all orders, continue alert (use eid= to target orders)
cancelall (-6): Cancel all orders, skip rest of alert (use eid= to target orders)
cancelside (-5): Cancel orders matching commands side (b=), skip rest of alert (use eid= to target orders)
closemarket (-4): Cancel orders, close all positions at market, skip rest of alert
closeall (-3): Cancel orders, close all positions, skip rest of alert
closeside (-2): Cancel orders, close all positions matching commands side (b=), skip rest of alert
abort (-1): Don't process any more commands in this alert
back (-0.5): Resume execution after the command that initiated the last jump
this (-0.2): Resume execution at the command right after the last jump mark (loop)
retry (0): Default – retry and/or continue with the next command (according to Exchange or local retry settings)
continue (0.5): Continue with the next command (no retries / same as retries=0 )
<number> / <label>: Skip over the next given number of commands or jump to given label
Note: If ep= is also specified, positions are closed via limit order (otherwise market) |
Error Handling Price |
ep , errorp , errorprice |
|
|
n/a |
Offset: <number>
Relative: <percent>%
Absolute: @<number>
Random: <min>-<max> / <min>%-<max>% |
Amount to undercut or overcut the top order in the book – either by percentage or absolute price in case positions are closed due to error handling! (see above)
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 ) |
Fallback Action |
fb , fallback |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / retry / continue / <number> / <label> |
Fallback action or jump mark (label) to be used in case a non existing label has been specified for another conditional option – useful if placeholders like [id] or [sym] are used for jump marks and not all possible values can be defined! |
FIFO |
fifo |
|
|
1 |
0 / off / false ; 1 / on / true |
SimpleFX only: Set FIFO order flag (true by default)
Note: If specified without a value it defaults to on/true, eg. fifo equals fifo=1 !
|
Fixed Price |
fp , fixed , fixedp |
|
|
n/a |
Static: <number>
Random: <min>-<max> |
Fixed price for which to place an order or filter by it (if used with cancel/check orders/positions command – more info on our Wiki! )
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 ) |
Guaranteed Stop Loss |
gsl , guaranteed |
|
|
0 |
0 / off / false ; 1 / on / true |
OANDA only: Used together with sl/stoploss (see further below) to place a guaranteed stop loss (for higher fees)
Note: If specified without a value it defaults to on/true, eg. gsl equals gsl=1 ! |
Hidden / Iceberg |
h , hidden , iceberg |
|
|
n/a |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Binance / Binance US: Portion of the order to be invisible
Bitfinex: Whether the order should be hidden (eg. h=1 = whole order invisible)
BitMEX / Deribit / KuCoin Futures: Portion of the order to be visible, rest will be hidden (eg. h=0 = whole order invisible) |
Custom Order ID |
id , custom |
|
|
n/a |
Anything (excluding special characters) |
Give the order a custom ID (if used with an order placing command) or filter by it (if used with cancel/check orders command) – for c/ch=order a comma separated list can be specified to check for any matches!
Note: When used with a cancel/check orders command the app checks if an order ID starts with any of the listed IDs – also supports wildcards eg. id=1H*SL,*TP
Native support: Binance, Binance Futures, BitMEX, Bybit, Deribit, FTX, Gemini, KuCoin, KuCoin Futures, OANDA, OKX, Phemex, SimpleFX
Using ID Cache: Bitfinex, Bittrex, Coinbase Pro, FTX (stop orders), Kraken, Kraken Futures, OKCoin, Poloniex
Note: If you are using IDs with exchanges that rely on the ID Cache please make sure to check the Custom Order ID Cache Time setting under ➔ General Options!
Note: As most exchanges require every order ID to be unique over a certain timeframe, clever mechanisms have been built in that "uniquify" every ID with a combination of alert/event id, command number and current timestamp etc. – if despite all of this you still receive an error about a duplicate order ID this usually points to a problem of running multiple app instances in parallel that try to place orders at the same time! |
Set Auto Interval |
interval |
|
|
n/a |
[<alert>,]interval |
Configure given ➔ PV Alert or current running alert (if none is specified) to run automatically according to the given interval
(best use the Edit interval button in the ➔ PV Alert Editor to create the correct syntax or look up "crontab syntax"!)
Note: If interval is specified as +<number> the alert will be configured to run once in given number of minutes from now – supports different time units eg. 1.5m for 90 seconds, 2.5h for 150 minutes etc.
Note: Alert can be specified by one of its names or by its unique ID (found under the name field of the expanded alert) – wildcards (* ) supported for alert names! |
If Alert(s) Enabled / Disabled |
ife , ifenabled , ifd , ifdisabled |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn below – specify what action to take when the alert(s) matching the checkalert command are enabled (ife= ) or disabled (ifd= )! |
If None Open / None Found |
ifn , ifnot , ifnone |
|
|
0 |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
Determines what to do IF the current command does NOT match (if used with ch ), cancel/close (if used with c ) or place at least one order/position – use either the listed values, their aliases or specify a custom jump label:
cancel (-7): Cancel all orders, continue alert (use cid= to target orders)
cancelall (-6): Cancel all orders, skip rest of alert (use cid= to target orders)
cancelside (-5): Cancel orders matching commands side (b=), skip rest of alert (use cid= to target orders)
closemarket (-4): Cancel orders, close all positions at market, skip rest of alert
closeall (-3): Cancel orders, close all positions, skip rest of alert
closeside (-2): Cancel orders, close all positions matching commands side (b=), skip rest of alert
abort (-1): Don't process any more commands in this alert
back (-0.5): Resume execution after the command that initiated the last jump
this (-0.2): Resume execution at the command right after the last jump mark (loop)
continue (0): Default – Continue with the next command
retry (0.5): Run the command again (same as jumping to a label right before the current command)
<number> / <label>: Skip over the next given number of commands or jump to given label |
If Open Or Found |
ifo , ifopen , iffound , ifmatch |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – works in the "opposite" way, specifying what action to take IF the conditions ARE met! |
If Bigger / Smaller |
ifbg , ifbigger , ifsm , ifsmaller |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – specify what action to take when the current commands returned position size (for check/close=pos ) or order quantity (for check/cancel=order or opening orders) is bigger or smaller than the last saved order quantity (in the variable lastqty ; see save= below) |
If Partially Filled |
ifp , ifpartial |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – will trigger if an order (for cancel/check=order ) was found and partially filled! |
If Long Or Short |
ifl , iflong , ifs , ifshort |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – will trigger if an order (for cancel/check=order ) or position (for close/check=pos ) for the specified side is found! |
If Min / Max Bid-Ask Spread |
ifminsp , ifmaxsp , ifminspread , ifmaxspread |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – specify what action to take when the spread between bid and ask price is lower (ifminsp ) than the minimum or higher (ifmaxsp ) than the maximum set with the min and max spread options (see minsp and maxsp below for more info!) |
If Slippage |
ifsl , ifslip |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – specify what action to take when slippage is higher than the maximum set with the max slippage option (see msl below for more info!) |
If Maximum Time |
ift , iftime |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – specify what action to take when more time than specified with time= has elapsed! (see time below) |
If Partially (Not) Filled after Maximum Time |
iftf , iftimefill , iftnf , iftimenofill |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – will trigger if maximum time elapsed AND an order was found afterwards and partially filled (iftf) or not filled at all (iftnf)! |
If (No) Position after Maximum Time |
iftp , iftimepos , iftnp , iftimenopos |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – will trigger if maximum time elapsed AND a position was found afterwards (iftp) or not (iftnp)! |
Is Isolated |
iso , isolated |
|
|
n/a |
0 / off / false ; 1 / on / true |
Binance / KuCoin Margin: Use isolated margin (instead of crossed) with spot margin order or transfer command (see transfer below)
Note: If specified without a value it defaults to on/true, eg. iso equals iso=1 ! |
Jump Delay |
jd , jumpdelay |
|
|
-3 |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Pauses execution between this and the next command for the specified time in seconds IF a conditional jump is made (eg. jd=7.5 )
Note: Use a negative value to delay only if execution jumps backwards – percentages are based on the bar time (chart resolution) of the alert! |
Jump Back Delay |
rd , retrydelay |
|
|
3 |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Shorthand for jumpdelay (see above) with negative value (delay only backward jumps) |
Leverage |
l , lev , leverage |
|
|
n/a (1) |
<number> (>= 0) |
Leverage, multiplying the available balance while increasing risk (!)
BitMEX: Use 0 for cross margin – on other exchanges see mt=crossed further below!
Where leverage can be changed: Binance Futures, BitMEX, Bitfinex, Bybit, FTX, Kraken, Kraken Flex Futures, KuCoin Futures, OANDA, OKX, Phemex
Where leverage is queried (when not given): Binance Futures, BitMEX, Bybit, Kraken Flex Futures, FTX, OANDA, OKX, Phemex
Note: When targeting multiple accounts via comma separated list in a= or ap= the leverage can be specified per account in the same way! (and in the same order as for a= / ap= )
Note: Acts only as a filter when used with c/ch=pos !
|
Leverage Calculation |
lc , levcalc |
|
|
1 |
<number> (>= 1) |
Override the amount of leverage used for internal quantity calculation for this order, ignoring what was auto detected (if supported) or specified via l= (see above) |
Leftover Quantity |
lq , leftover |
|
|
0 |
0 / off / false ; 1 / on / true |
If set to 1 will use previously saved "leftover" quantity from an unfilled or only partially filled order – see option save= below for more information (useful for trailing limit entry loops, optionally in conjunction with max slippage)
Note: If specified without a value it defaults to on/true, eg. leftover equals leftover=1 ! |
Leverage Reference |
lr , lref |
|
|
n/a |
custom<number> / _somename |
Specifies from which custom plot data to take an optional multiplier by which the given leverage (see leverage= above) is multiplied
Note: Since version 1.3 instead of using the reference options you can specify custom plot variables directly in the original parameters – in this case l=_someplot , optionally with a multiplier (* ) or divider (/ ) eg. l=_someplot*3
See Price Reference below for info on custom plot names! |
Loan / Borrow |
loan |
|
|
n/a |
<asset> (BTC / BNB / ...) |
Binance / KuCoin: Apply for margin account loan of assets (comma separated list for multiple assets, use q to specify amount)
Note: When using relative quantities, upper/lower limits can be defined by using minq= / maxq= options! |
Lock / Unlock |
lock |
|
|
n/a |
1 / -<number> / 0, <ex:sym> / <name>, <timeframe> |
1: Lock symbol to ignore all consecutive alerts (same as alert filter options)
-<number> (negative number): Same as above, but set lock expiration time to given number of minutes
0: Remove lock from symbol / alert (Unlock)
Optionally specify symbol (in the form of exchange:symbol ) and timeframe (in minutes)
Note: Expiration and timeframe support different time units eg. 1.5m for 90 seconds, 2.5h for 150 minutes etc.
Note: Instead of exchange:symbol a custom lock name can be specified as well – more info on our Wiki! |
Check Lock |
lockcheck |
|
|
n/a |
1 / 2, <ex:sym> / <name>, <timeframe> |
1: Check for lock from same timeframe, treat as error if lock found
2: Same as above (check for lock) but ignores timeframe
Optionally specify symbol (in the form of exchange:symbol ) and timeframe (in minutes)
Note: Instead of exchange:symbol a custom lock name can be specified as well – more info on our Wiki! |
Log Level |
log , loglevel |
|
|
n/a |
all / nosyntax / nodebug / cond / warn / err / debug / none |
Log level to use for this command
all (15): Log everything
nosyntax (31): Log everything excluding raw syntax
nodebug (14): Log everything excluding debug information
cond (8): Only log conditionals
warn (6): Only log warnings and errors
err (2): Only log errors
debug (1): Only log debug information
none (0): Nothing at all being logged
Note: Only effective if less than the alert log level (add '!' in front to force a higher log level) |
Is Margin Trade / Check |
margin , ismargin |
|
|
0 |
0 / off / false ; 1 / on / true |
Place as margin order instead of spot; alternative to b=long/short
Note: If specified without a value it defaults to on/true, eg. iso equals iso=1 ! |
Min / Max Balance |
minb / minbalance , maxb / maxbalance |
|
|
n/a |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Check for minimum and maximum balance, if below (or above for maxb ) treat as error
Note: Percentages are resolved based on the account equity (total balance incl. profit/loss)
Note: When targeting multiple accounts via comma separated list in a= or ap= this option can be specified per account in the same way! (and in the same order as specified for a= / ap= ) |
Min / Max Historic Volatility |
minhvd / mindailyvola , maxhvd / maxdailyvola |
|
|
n/a |
<number> (> 0) |
Minimum and maximum daily BTC volatility index check (via BitMEX API) – if below or above treat as error
Use minhvw & maxhvw for the weekly or minhvm & maxhvm for the monthly index
Click here for more info from BitMEX!
Note: Requires permission to connect to bitmex.com even if not otherwise used! |
Min / Max Price |
minp / minprice , maxp / maxprice |
|
|
n/a |
<number> |
Set absolute minimum and/or maximum limits for relative price calculations
Note: When targeting multiple accounts via comma separated list in a= or ap= this option can be specified per account in the same way! (and in the same order as specified for a= / ap= ) |
Min / Max Profit Loss |
minpl / minpnl , maxpl / maxpnl |
|
|
n/a |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Filter open positions for c or ch commands by their current profit and loss
(use either absolute contracts/units or PnL %)
Note: See plref below to select which relative PnL to compare!
Note: When targeting multiple accounts via comma separated list in a= or ap= this option can be specified per account in the same way! (and in the same order as specified for a= / ap= ) |
Min / Max Quantity |
minq / minquantity , maxq / maxquantity |
|
|
n/a |
<number> |
Set absolute minimum and/or maximum limits for relative quantity calculations
(specified in contracts or the markets native "currency")
Note: When targeting multiple accounts via comma separated list in a= or ap= this option can be specified per account in the same way! (and in the same order as specified for a= / ap= ) |
Min / Max Position Size |
mins / minsize , maxs / maxsize |
|
|
n/a |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Filter open positions for c or ch commands by their current size – use either absolute contracts/units or % (based on available balance, use y=equity to base on total account equity)
Note: When targeting multiple accounts via comma separated list in a= or ap= this option can be specified per account in the same way! (and in the same order as specified for a= / ap= ) |
Min / Max Size Reference |
minsr , minsizeref , maxsr , maxsizeref |
|
|
n/a |
custom<number> / _somename |
Specifies from which custom plot data to take an optional multiplier by which the given min / max position size (see mins= etc. above) is multiplied
Note: Since version 1.3 instead of using the reference options you can specify custom plot variables directly in the original parameters – in this case mins=_someplot , optionally with a multiplier (* ) or divider (/ ) eg. mins=_someplot*3
See Price Reference below for info on custom plot names! |
Min / Max Bid-Ask Spread |
minsp , minspread , maxsp , maxspread |
|
|
n/a |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Optional parameter to be used with a market or limit (opening) order command – calculates the bid-ask spread of the price ticker and only places the order if the calculated spread is above the specified minimum and below specified maximum (see spa= /spb= below on how to use different price data for calculation)
Note: When targeting multiple accounts via comma separated list in a= or ap= this option can be specified per account in the same way! (and in the same order as for a= / ap= ) |
Min / Max Bid-Ask Spread Reference |
spa , spreadask , spb , spreadbid |
|
|
n/a |
ask / bid / mid / last / pos / even / mark / index / price (open / high / low / close / oc / hl / custom<number> / _somename) |
Override the default price reference (bid ticker data for lower bid, ask ticker data for higher ask) for bid-ask spread calculation
Also see Price Reference below! (section about OHLCV data from TradingView) |
Max Slippage |
msl , maxslip |
|
|
n/a |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Optional parameter to be used with a market or limit (opening) order command – compares the current ticker price to the last cached price (use updateprice before in that case) or OHLC / custom plot data (see mslr= below) and only places the order if the price is not further against us than specified (a better entry price is always accepted!)
Note: When targeting multiple accounts via comma separated list in a= or ap= this option can be specified per account in the same way! (and in the same order as for a= / ap= ) |
Max Slippage Reference |
mslr , maxslipref |
|
|
n/a |
ask / bid / mid / last / pos / even / mark / index / price (open / high / low / close / oc / hl / custom<number> / _somename) |
Override the default price reference (auto detected, depending on book side) for slippage comparison
Also see Price Reference below! (section about OHLCV data from TradingView) |
Min / Max Price Change |
min1h / max1h , min24h / max24h , min7d / max7d |
|
|
n/a |
<number> |
Check CoinMarketCap price ticker for minimum and/or maximum hourly (1h), daily (24h) or weekly (7d) price change percentage – if under or over treat as error |
Margin Type |
mt , margintype |
|
|
n/a |
isolated / iso ; crossed / cross ; borrow / repay |
Binance Futures / Bybit / Kraken Flex Futures / OKX / Phemex: Switch symbol margin type to specified type when placing this order
Binance / KuCoin Margin: borrow = auto borrow margin order, repay = auto repayment after order filled |
If No Position / Order |
nr , noresult , nopos , noorder |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – specify what action to take when no position (for c/ch=pos ) or order (for c/ch=order ) at all is open; to be used with filtering options to distinguish between "no filter match" and "nothing at all" conditions! |
Send Notifications |
n , notify |
|
|
n/a |
Target:"Message":"Subject":Recipient, ...
0, 1, 2, 3 |
Send custom messages to the specified platforms or enable/disable notifications
target: any of...
d / discord = Discord (optionally with :webhook ),
e / email = Email (optionally with :subject & :recipients ),
i / ifttt = IFTTT,
l / log = Log (optionally with :loglevel 0-6),
s / sms / twilio = Twilio (optionally with :recipient-nr ),
t / telegram = Telegram (optionally with :chat-id )
0, 1: Disable/suppress or enable/force built-in notifications for this command
2: Force built-in notifications including balance info for this command
3: Force built-in notifications including balance and account info for this command
4: Force built-in notifications including balance, account and leverage info for this command
All syntax parameters (p , q etc.) can be used in custom messages via {fieldname} – and if an order was created or checked/canceeld all returned order/position fields (check ➔ the log to see what a particular exchange sends!)
Optionally numbers in fields can be formatted via {field.x} eg. {price.3} outputting 123.456 – for text the same format will truncate it to the specified number of "subparts" eg. {lastid.2} will shorten an order ID like SOME-ENTRY-ALERT-12345 to SOME-ENTRY
Other pre-defined fields: alert , account , exchange , leverage , bartime , time , balance , available , total , price
For positions: _date , _entry , _profit , _side , _size , _sizeCoin , _sizeUSD , _symbol , _symbols (multiple orders / positions), pnl , pnlLev , pnlTotal , relSize
With cached price (or up=1 ): ask , bid , mid , custom1 .. etc.
Note: Since version 1.3.35 calculations (+ (addition), - (subtraction), / (division), * (multiplication), % (modulo) and ^ (power of)) are supported for numeric fields in placeholders – eg. {price-close} (use : to specify number of decimals eg. {price/2:3} produces 12345.123)
See examples! (.. and more on our Wiki ) |
PnL Reference |
plref , pnlref |
|
|
lev |
pos / lev / total |
Specify which position relative profit/loss value (%) to use for min/max PnL checks:
pos: PnL relative to the unleveraged margin used by the position
lev: Same as pos but taking position leverage into account (multiplied by leverage)
total: Current PnL in relation to total account equity (use y=balance for relation to available equity)
(all three values are printed in this order for position info output in the log) |
Price |
p , price |
|
|
0 |
Offset: <number>
Relative: <percent>%
Absolute: @<number>
Random: <min>-<max> / <min>%-<max>% |
Amount to undercut or overcut the top order in the book – either by percentage or absolute price!
Note: When targeting multiple accounts via comma separated list in a= or ap= the price can be specified per account in the same way! (and in the same order as specified for a= / ap= )
Note: For relative ranges both values have to be specified in % eg. q=2%-5% !
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 ) |
Price Bound |
pb , bound |
|
|
n/a |
Offset: <number>
Relative: <percent>%
Absolute: @<number>
Random: <min>-<max> / <min>%-<max>% |
OANDA only: Worst market price allowed for an order to be filled at
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 ) |
Price Reference (TP/SL/TS/SO Reference) |
pr , priceref , tpref , slref , tsref , soref , trref / transref |
|
|
bid (for buy) ;
ask (for sell) ;
pos (for c=pos with tp sl so ts ) |
ask / bid / mid / last / pos / even / liq / mark / index / price (open / high / low / close / oc / hl / custom<number> / _somename) |
ask / bid: Force to use last ask or bid price as reference for p , tp , sl etc., no matter what side of the book
(bid is default for buy / long orders, ask for sell / short orders)
mid: Use the average (middle) of last ask and bid price as reference
last: Use the exchange's "last trade price" as price reference (not available on Deribit and OANDA)
price: Use the final calculated order price as stop price reference (only for tp , sl , so or ts !)
lastprice: Price from a previous order or position saved with the save command (previous values as lastprice2 / lastprice3)
lastavg: Same like lastprice but averaged over all previously saved prices in the current alert
laststop: Stop price from a previous order saved with the save command (previous values as laststop2 / laststop3)
Binance Futures / Bitfinex / BitMEX / Bybit / Deribit / FTX / Kraken / Kraken Futures / KuCoin Futures / OANDA / OKX / Poloniex / Phemex:
pos: Use the average entry price of the position (default for c=pos with any of tp , sl , so or ts !)
BitMEX / FTX:
even: Use the price where the position reaches break even
Binance Futures / BitMEX / Bybit / Deribit / FTX / KuCoin Futures / OKX / Phemex:
liq: Use the estimated liquidation price of the position
Binance Futures / BitMEX / Bybit / Deribit / Kraken Futures / KuCoin Futures:
mark: Use the exchange's "mark price" as price reference (Binance FT and Bybit also offer pr=index in addition)
Optionally, if OHLCV data was sent from TradingView:
open, high, low, close: OHLCV data from the candle that triggered the alert
oc: Average price between open and close
hl: Average price between high and low
custom<number>: Custom data/plots added via ,{{plot_0}},{{plot_1}},...
_somename: Custom data/plots when given a name (see below)
Add the following as last line in a TradingView alert #{{open}},{{high}},{{low}},{{close}},{{volume}} – optionally add ,{{plot_0}} or ,somename:{{plot_0}} for custom plots to be referenced in syntax!
Note: The [side] placeholder for unified alerts can also be controlled this way (making a single entry alert possible for example!) – following variants are supported:
side:1:0 / side:0:1 (useful for two bool plots, one per side)
side:1 / side:-1
side:long / side:short
side:buy / side:sell (useful for strategy alerts)
Note: Since version 1.3 instead of using the reference options you can specify custom plot variables directly in the original parameters – eg. q=_someplot , optionally with a multiplier (* ) or divider (/ ) eg. q=_someplot*3 or interpreted as percantages eg. q=_someplot% (allowed operators for q= and l= are '*' and '/', for all other parameters '+' and '-'!)
Click here for more info!
|
Position Mode |
pm , posmode |
|
|
auto |
normal / oneway ; hedge / hedged ; auto |
Binance Futures / Bybit / OKX Futures & Swap / Phemex only: Position mode for order or to filter by (for c/ch=pos ; Binance only)
Note: Will switch hedge mode on or off if necessary – auto (default!) will place the order according to current state! |
Price Protect |
pp , protect |
|
|
n/a |
0 / off / false ; 1 / on / true |
Binance Futures (stop order) only: When price reaches the stop price, the difference between mark and contract price cannot be larger than the "trigger protect" of the symbol
Note: If specified without a value it defaults to on/true, eg. pp equals pp=1 ! |
Quantity |
q , quantity , amount |
|
|
100% |
Static: <number> / <percent>%
Random: <min>-<max> / <min>%-<max>% |
Portion of the balance or position (for c=pos ) that should be used for the order
(based on available balance, use y=equity to base on total account equity or y=pos to base on position size – see yield option below!)
For absolute values see unit option below and find more info on our Wiki!
Supported shorthands: q=50%p for q=50% yield=pos // q=50%e for q=50% yield=equity // q=50$ for q=50 unit=currency
Note: When targeting multiple accounts via comma separated list in a= or ap= the quantity can be specified per account in the same way! (and in the same order as specified for a= / ap= )
Note: For relative ranges both values have to be specified in % eg. q=2%-5% ! |
Quantity Reference |
qr , qref , sizeref |
|
|
n/a |
custom<number> / _somename |
Specifies from which custom plot data to take an optional quantity multiplier
Note: Is applied after the regular quantity parameter is resolved – eg. q=50% qref=_someplot will first calculate the quantity for half the available balance and if the custom plot data contains the value 0.2 for example, the final quantity would be 0.2 times (20%) of that 50% available balance = 10%
Note: Since version 1.3 instead of using the reference options you can specify custom plot variables directly in the original parameters – in this case q=_someplot , optionally with a multiplier (* ) or divider (/ ) eg. q=_someplot*3 or as percentage q=_someplot%*3
See Price Reference above for info on custom plot names! (in addition you can use lastqty to reference the leftover quantity or filled to reference the filled quantity from a previous order saved with the save command) |
Reduce Only |
r , reduce |
|
|
0 ;
1 (for c=pos !) |
0 / off / false ; 1 / on / true |
Binance Futures / BitMEX / Bybit / Deribit / FTX / Kraken / Kraken Futures / KuCoin Futures / OANDA / OKX / Phemex: Place order with reduce only flag so it cannot increase or flip position
(or filter by it if used with cancel/check orders command – more info on our Wiki! )
Note: Enabled by default for position closing orders, so for c=pos there is no need to specify r=1 !
Note: Where supported special position closing orders are used automatically for c=pos which are usually exempt from load shedding while "reduce only" orders can fail! (see BitMEX API documentation for example)
Note: If specified without a value it defaults to on/true, eg. reduce equals reduce=1 ! |
Repay Loan |
repay |
|
|
n/a |
<asset> (BTC / BNB / ...) |
Binance / KuCoin: Repay margin account loan for assets (comma separated list for multiple assets, use q to specify amount)
Note: When using relative quantities, upper/lower limits can be defined by using minq= / maxq= options! |
Return Expected |
ret , return , expect |
|
|
1 |
<number> |
Command is expected to return an order / at least number of orders (minimum) or none (ret=0), otherwise treat as error (retry etc.); also checks the number of matching positions for check=pos
(negative number = skip retries!) |
Number of Retries |
retries |
|
|
Exchange Setting |
<number> |
Number of times the command is repeated in case of an error (overriding Exchange specific global settings) |
Retry Until Filled |
rf , fill |
|
|
1 |
0 / off / false ; 1 / on / true |
FTX (stop order) only:: Whether or not to keep re-triggering until filled (true by default) |
Run Alert |
run , runen |
|
|
n/a |
<alert> |
Run specified ➔ PV Alert using currently set exchange, symbol, account, OHLCV data and custom variables/plots (can be overridden within the alert) and wait for it to execute completely – similar to "including" the other alert!
The following parameters can be used with this command to specify different default values:
e (Exchange), s (Symbol), a (Account), b (Side)
Note: All filtering / locking etc. settings of the "included" alert are ignored – use runen to only run enabled alerts (otherwise also disabled alerts are run)!
Note: Alert can be specified by one of its names or by its unique ID (found under the name field of the expanded alert) – wildcards (* ) supported for alert names, but only first match will be run! |
Symbol |
s , sym , symbol |
|
|
Chart Symbol from Alert |
<symbol> (XBTUSD / ETHEUR / ...) |
Market on the receiving exchange to be targeted by this command – on margin exchanges specify sym=* with check=pos or close=pos to target all markets on the selected exchange!
Note: When targeting multiple accounts via comma separated list in a= or ap= the symbol can be specified per account in the same way! (and in the same order as for a= / ap= )
Note: It is highly recommended to use the Symbol button (found in the alert editor and under the exchange settings) to insert exchange and symbol options conveniently and safely!
More info about built-in market/symbol name mapping on our Wiki |
Since (Time / Count Reference) |
since |
|
|
fired |
fired / bar / candle |
Specify which time / count reference to use for maximum time/count elapsed checks (see time= below)
fired: Default, time since the alert was fired and started to execute
bar / candle: Time since the current alerts bar started (depends on the alerts bar resolution used) |
Skip / Jump |
skip , jump , goto , go , do , loop |
|
|
continue / 0 ;
this / -0.2 (for loop ) |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / retry / continue / <number> / <label> |
Skip over the next given number of commands (-1 = all) or jump to given label, unless error
Note: See err= above for all available options! |
Stop Loss |
sl , stoploss |
|
|
n/a |
Offset: <number>
Relative: <percent>%
Absolute: @<number>
Random: <min>-<max> / <min>%-<max>% |
Bybit / OANDA / SimpleFX: Can be used as option with opening order to set TP/SL on-fill (managed by the exchange)!
All Spot: Place stop loss option with main buy/sell
All Margin: Place buy/sell order when price hits stop price (or close position with c=pos , also see pr above)
(or filter by it if used with cancel/check orders command – more info on our Wiki )
Note: When targeting multiple accounts via comma separated list in a= or ap= the stop loss can be specified per account in the same way! (and in the same order as specified for a= / ap= )
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 ) |
Stop Order Price |
so , stop |
|
|
n/a |
Offset: <number>
Relative: <percent>%
Absolute: @<number>
Random: <min>-<max> / <min>%-<max>% |
Bybit / OKX / Phemex: Place buy/sell order when price hits stop price, can be used with normal orders to place as stop instead of SL/TP attributes with main order or OCO
Binance / Binance Futures / Bybit Inverse Futures & Inverse Perpetual / OKX / Phemex: Same as above, can be used in conjunction with trailing stop (ts=123 ) to specify activation price
BitMEX / Coinbase / FTX / Gemini / KuCoin / KrakenFT / OANDA / Phemex: Place buy/sell order when price hits stop price (plain stop/conditional order; often same as SL stop)
Note: When targeting multiple accounts via comma separated list in a= or ap= the stop can be specified per account in the same way! (and in the same order as for a= / ap= )
Note: For custom OHLC/variable stop price reference see soref above!
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 ) |
Stop Reference |
sr , stopref |
|
|
last |
last / mark / index |
BitMEX / Bybit / Deribit / Kraken Futures / KuCoin Futures / OKX / Phemex: Which contract reference price type should be used to trigger this stop (default: last)
Binance Futures: "mark" or "contract" (default: contract)
Note: For custom OHLC/variable stop price reference see soref above! |
Save Order Data |
sv , save |
|
|
0 |
0 / off / false ; 1 / on / true |
Saves the following attributes from the first returned order (c/ch=order or opening order) or position (c/ch=pos ) per account locally for the current running alert: filled , left , lastqty , lastqtysum , lastprice , lastavg , laststop , lastid , lastside , lasttype , laststatus , lastpnl , lastpnltotal , lastpnlsum , lastnum , lastnumsum ; additionally lastask , lastbid , lastmid when price ticker data was queried by the command
Note: Previously saved values can be accessed via field2 / field3 – eg. lastprice2
(see lq= , pr= , n= etc. above – can be used in custom notification fields)
Note: If specified without a value it defaults to on/true, eg. save equals save=1 ! |
Order Type |
t , type |
|
|
limit |
limit / market / fok / ioc / post / day / settle / open / close |
Limit: Place order on the books waiting to be filled for price p
Market: Fill order immediately for whatever prices are available (p is ignored – slippage!)
FOK: Fill Or Kill orders will be cancelled if they cannot be filled immediately completely
IOC: Immediate Or Cancel orders can be partially filled – any remaining portion is cancelled
Post: If any part of the order would be filled immediately (for price p ) the whole order will be cancelled
Day (BitMEX / OANDA): "Good For Day", will be cancelled at 5pm EDT (New York)
Settle (Kraken): Settle position(s) at the original order price Click here for more info from Kraken!
Open / Close: Can be used together with c=order for specific order types – open targets limit/opening orders, close targets stops/closing orders |
Transfer Balance |
tb , transfer |
|
|
n/a |
<asset> (BTC / BNB / ...) |
Binance: Transfer balance from spot to margin (y=spot ) or margin to spot account (y=margin ) for specified assets (comma separated list for multiple assets, use q to specify amount, use iso=1 s=symbol to target isolated instead of cross margin balance!)
Deribit: Transfer balance(s) to subaccount – comma separated list for multiple assets, use q to specify amount and y to specify id or alias of target subaccount
FTX: Transfer balance(s) to subaccount – comma separated list for multiple assets, use q to specify amount and y to specify nickname of target subaccount (or source and target subaccount in the form of y=source:target !)
Note: When using relative quantities, upper/lower limits can be defined by using minq= / maxq= options! |
Transpose Plots |
tr , transpose |
|
|
n/a |
custom<number> / _somename (list) |
Transposes all specified custom plot points from OHLC close price as base to the current ticker price (according to either trref= or pr= option, see above) of the current command as base – by converting them first into relative offsets from OHLC close and then back into absolute prices from new base
Note: If an absolute value is present in the given list it is used as a factor for the following plot transpositions – eg. tr=_tp,0.7,_sl transposes the custom plot "tp" fully (for example 1%) but the custom plot "sl" is additionally multiplied by 0.7 (for example -1% turning into -0.7%)!
Note: Requires OHLC data from TradingView to be present in the alert message – see option pr= above! |
Trigger Alert |
trigger , triggeren |
|
|
n/a |
Anything (excluding special characters) |
Trigger specified ➔ PV Alert using currently set exchange, symbol, account, OHLCV data and custom variables/plots (can be overridden within the alert) and immediately resuming running this alert in parallel – similar to triggering the other alert externally via an event!
Note: All filtering / locking etc. settings of the triggered alert are ignored – use triggeren to only trigger enabled alerts (otherwise also disabled alerts are triggered)!
Note: Alert can be specified by one of its names or by its unique ID (found under the name field of the expanded alert) – wildcards (* ) supported for alert names, but only first match will be triggered! |
Maximum Time Elapsed |
time , maxtime |
|
|
n/a |
Static: <number> / <percent>% (of bar time)
Random: <min>-<max> / <min>%-<max>% |
Maximum time allowed to have passed since the initial firing of an alert (or since the beginning of the current bar if since=bar is specified) in either seconds or as % of bar time – will be treated as error if more time has passed, unless ift= is specified (see further above)
Note: Time is always checked before a command line containing this option is executed – thus if too much time already passed when reaching this line the rest of the line will be ignored! |
Retry Timeout |
timeout |
|
|
Exchange Setting |
<number> (> 0) |
Timeout in seconds between command retries in case of an error (overriding Exchange specific global settings) |
Toggle Alert |
toggle |
|
|
n/a |
<alert> ; PV / APP |
Toggle given ➔ PV Alert or current running alert (if none is specified) between enabled/disabled
To toggle running of any received alerts (global "pause" mode) use toggle=app
Note: Alert can be specified by one of its names or by its unique ID (found under the name field of the expanded alert) – wildcards (* ) supported for alert names! |
Take Profit |
tp , takeprofit |
|
|
n/a |
Offset: <number>
Relative: <percent>%
Absolute: @<number>
Random: <min>-<max> / <min>%-<max>% |
Bybit / OANDA / SimpleFX: Can be used as option with opening order to set TP/SL on-fill (managed by the exchange)!
All Spot: Place take profit with main buy/sell
All Margin: Place buy/sell when price hits stop price (or close position with c=pos , also see pr above)
(or filter by it if used with cancel/check orders command – more info on our Wiki! )
Note: When targeting multiple accounts via comma separated list in a= or ap= the take profit can be specified per account in the same way! (and in the same order as specified for a= / ap= )
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 ) |
Trailing Stop |
ts , trailing |
|
|
n/a |
Offset: <number>
Relative: <percent>%
Absolute: @<number>
Random: <min>-<max> / <min>%-<max>% |
Binance / Binance Futures / Bitfinex / BitMEX / Bybit / Deribit / FTX / Kraken / Kraken Futures / OANDA / OKX / Phemex: Trailing stop offset (trailing starts immediately when placed!)
Binance / Binance Futures / Bybit Inverse Futures & Inverse Perpetual / OKX / Phemex: Optionally specify activation price via so=123 !
(usually used with close position c=pos , also see pr above)
Note: When targeting multiple accounts via comma separated list in a= or ap= the trailing stop can be specified per account in the same way! (and in the same order as specified for a= / ap= )
Note: Absolute prices can also be entered for all price parameters by prefixing them with @ ! (eg. p=@7500 )
Find more info regarding trailing on our Wiki! |
Unit |
u , unit |
|
|
contracts |
contracts / ct ; currency / ccy |
Unit to be used for absolute values in the provided quantity (q ) and min/max position size (mins /maxs ) parameters (ignored for percentages!)
Find more info regarding units on our Wiki! |
Update Balance |
ub , updatebalance |
|
|
n/a |
0 / off / false ; 1 / on / true |
Update balance info – use to query the current account balance (eg. for notifications) without executing a trade
Note: If specified without a value it defaults to on/true, eg. ub equals ub=1 ! |
Update Price |
up , updateprice |
|
|
n/a |
0 / off / false ; 1 / on / true |
Update and cache price data (ticker) for a symbol – use on its own or as a trade option
When used with the save option (see above) these additional variables are saved: lastask , lastbid , lastmid
Note: If specified without a value it defaults to on/true, eg. up equals up=1 ! |
Failed Order ID Check |
wid , wrongid |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – specify what action to take when no order was found matching the given ID or list of IDs (see cid above for more info!) |
Wrong Side |
ws , wrongside |
|
|
n/a |
cancel / cancelall / cancelside / closemarket / closeall / closeside / abort / back / this / continue / retry / <number> / <label> |
See ifn above – specify what action to take when an open position (for c/ch=pos ) or order (for c/ch=order ) was found but it is on the opposite side of the given book parameter (b= /side= , see above) |
Yield |
y , yield |
|
|
free ;
pos (for c=pos ) |
free / balance ; total / equity ; pos / possize |
Which part of equity to use as base for relative quantity calculations – default for c=pos is pos , otherwise free !
free / balance: Available free balance excluding open positions
total / equity: Total account equity including all profit and loss
pos / possize: Size of current open position (default for c=pos ) |