Syntax Maker

With the release of the new JuBot Syntax Maker, you can have your ideal set of syntax conveniently generated for you.

Required Syntax

Your TradingView alert message field must contain one of the following (only pick one!): ENTRY LONG , ENTRY SHORT, EXIT LONG, EXIT SHORT, EXIT ALL
JuBot automatically cancels all orders and closes all positions before any strategy entry/exit is made. This means it only requires 1 command most of the time.
This means an "ENTRY LONG" will do the following: cancel all orders for this symbol, cancel all positions for this symbol, place an order based on the settings given. Likewise an "EXIT SHORT" will do the following: cancel all orders for this symbol, cancel all positions for this symbol
ENTRY has 4 required fields: e, s, q, tf
EXIT has 3 required fields: e, s, tf

Syntax Explanation
e Name of exchange (e=oanda only please)
s Symbol of the instrument being traded. eg EURUSD on TradingView is listed as EUR/USD on Oanda. You can enter it in the format of EURUSD , EUR/USD or EUR_USD
q Quantity being traded. If the quantity ends in '%' it will use a percentage of your current available margin balance to trade. If no '%' is present at the end, it will use a fixed number of contracts as the trade size

EXIT alerts normally default to closing 100% of the open position. Setting a q=#% will mean that only a portion of the open position is closed. The quantity q must end with a '%' for EXIT alerts.
tf Timeframe, enter your timeframe in seconds, this enables the TradingView duplicate detection feature to work. (eg 3H = 10800) If not specified, the value "Default Timeframe" option in the Settings tab is used. For example if you have 4 strategies, 3 of them use 2H timeframe, and one of them uses 1H, then for the 1H strategy, set "tf=3600". The other 3 strategies will default to the "Default Timeframe" option in the Settings tab which is 7200 seconds or 2H.
When writing your syntax, please make sure that you have an actual space/gap between the commands, having a new line might not necessarily mean there was a proper " " space between the commands.

Easy Examples

  1. This will submit an ENTRY LONG that will long 500 EUR_USD contracts at market price. This happens to be a 15M strategy.
    ENTRY LONG e=oanda s=EUR_USD q=500 tf=900

  2. This will submit an ENTRY LONG that will short EUR_USD contracts worth 10% of your current available margin balance (including leverage) at market price. This happens to be a 30M strategy.
    EXIT LONG e=oanda s=EUR_USD q=10% tf=1800

  3. This will submit an EXIT LONG that will exit all positions in USD/CAD. This happens to be a 2H strategy.
    EXIT LONG e=oanda s=USD_CAD tf=7200

  4. This will submit an EXIT SHORT that will exit all positions in USD/CAD. This happens to be a 1H strategy.
    EXIT LONG e=oanda s=USD_CAD tf=3600

Optional Syntax

Syntax Explanation
a API account to use, default is set to "a = 1" if you dont fill it in, this corresponds to the first set of Token/AccountID for the exchange.
n Strategy name (optional)(mostly cosmetic but recommended)
p Price (if "p" is provided, the order is submitted as a limit order. If "p" is not provided, the order is submitted as a Market order) This price is set relative to the current MidPrice, ie the price between the MarketBuy and MarketSell price. Hence if you wanted to put a limit order right on this price, you would put p=0% (make sure you only enter POSITIVE NUMBERS and don't forget to add the % at the end)(eg "p=2%") (NOTE: Make sure price is POSITIVE, no negative prices) (Eg p=2% for an ENTRY LONG means the order will be placed at 2% lower than the current MidPrice) (Eg p=2% for an ENTRY SHORT means the order will be placed at 2% higher than the current MidPrice)
sl Stop loss (default is 0 ie disabled)(make sure you only enter POSITIVE NUMBERS and don't forget to add the % at the end)(eg "sl=2%") The stop loss order is made as "GoodTillCancel" (NOTE: Make sure stop loss is POSITIVE, no negative stop losses) Eg if you are in a short and you set sl=2%, a conditional market order will be placed and this might trigger, closing off your short if the mark price moves against you by 2% (ie 2% higher than your short entry price) Likewise if you are in a long and you set sl=2%, a conditional market order will be placed and this might trigger, closing off your long if the mark price moves against you by 2% (ie 2% lower than your long entry price)
ts Trailing stop (default is 0 ie disabled)(make sure you only enter POSITIVE NUMBERS and don't forget to add the % at the end)(eg "ts=2%") The trailing stop order is made as "GoodTillCancel" (NOTE: Make sure stop loss is POSITIVE, no negative trailing stop losses)
tp Take profit (default is 0 ie disabled)(make sure you only enter POSITIVE NUMBERS and don't forget to add the % at the end)(eg "tp=2%") (NOTE: Make sure stop loss is POSITIVE, no negative take profits) Eg if you are in a short and you set tp=2%, a limit buy order will be placed at 2% lower than your short entry price Likewise if you are in a long and you set tp=2%, a limit sell order will be placed at 2% higher than your long entry price

Note: For p, tp, sl syntax you can use ABSOLUTE values ie without the % at the end, take note that tp=2.0 means a take profit order at a price of 2.0 is placed, hence this is not relative to the current price.

More Examples

  1. This submits an ENTRY LONG on account 1, that will long 500 contracts worth of SGD/CHF using a limit order with the price equalling the current MidPrice, also putting down a take profit of 2% (ie a limit sell order set at 2% higher than the long entry price). This happens to be a 2H strategy.
    ENTRY LONG a=1 n=mystrat e=oanda s=sgd_chf q=500 p=0% tf=7200 tp=2%

  2. This submits an ENTRY SHORT on account 2, that will short 100 contracts worth of EUR/USD using a limit order with the price 1% higher than the current MidPrice, also putting down a stop loss of 2% (this triggers a market buy to close the short position if the market moves against you by 2%, ie 2% higher than your short entry price). This happens to be a 1H strategy.
    ENTRY SHORT a=2 n=mystrat e=oanda s=eur_usd q=100 p=1% tf=3600 sl=2%

  3. This submits an EXIT LONG on account 1 to cancel all positions in EURUSD, by placing a limit order with price set at 2% higher than the current MidPrice. This happens to be a 2H strategy.
    EXIT LONG a=1 n=mystrat e=oanda s=eur_usd p=2% tf=7200

  4. This submits an EXIT SHORT on account 2 to cancel all positions in EURUSD, by placing a limit order with price equalling the current MidPrice. This happens to be a 1H strategy.
    EXIT SHORT a=2 n=mystrat e=oanda s=eur_usd p=0% tf=3600

Advanced Syntax

Because how Oanda orders are structured, only a subset of the normal syntax are implemented. There is no laddering of ENTRY orders or take profit orders (when lodged with an ENTRY order). When lodged together with an ENTRY order, take profit will always be for 100% of the order's quantity. (For reference, this is the same behaviour on their website) Only sco and scp syntax are supported.

In addition to the standard 4 alerts of ENTRY LONG, ENTRY SHORT, EXIT LONG, EXIT SHORT, you can also use the following:
EXIT ALL = same effect as EXIT LONG or EXIT SHORT, but is given purely for users that want this option for visual purposes etc
Syntax Explanation
sco Skip cancelling order before the main order is done, (default is 0)

Usual flow of an ENTRY order:
Cancel Order (sco=1 will skip this step)
Cancel Position
Main Entry Order
scp Skip cancelling position before the main order is done, only works for ENTRY alerts (default is 0) - If you plan to use this to do dual orders/pyramiding orders etc, make sure the very first ENTRY does NOT have scp

Usual flow of an ENTRY order:
Cancel Order
Cancel Position (scp=1 will skip this step)
Main Entry Order

Additional options to regular syntax:
Syntax Explanation
a If you want to clone/duplicate the alert onto multiple accounts , just put a comma, eg a=1,2,3,4,5 (make sure there is no space after the comma). This will clone exactly the action onto multiple accounts. Hence one single ENTRY LONG can affect many accounts if you wish. Alternatively, if you want to act on ALL given API keys, use a=all