OANDA Command Reference Manual

General Overview

Autoview is a powerful tool for automated trading strategies, integrating seamlessly with various exchanges. It enables users to create and execute complex trading commands based on pre-defined parameters, offering efficiency and precision in trading operations. Autoview's customizable approach allows traders to adapt to different market conditions and strategies, making it a versatile solution for both novice and experienced traders.


Usage Rules

  • Every command seen by Autoview is a single order.
  • You can palce as many commands in a single alert as you need.
  • Every command needs to be separated by a new line or the pipe character (|).
  • Every parameter can be used once per command.
  • Most parameters accept static values (10), percentages (10%) and ranges for randomization (10-20).
  • 95% of the errors passed through Autoview are directly from the exchange. Their documentation will be used more than ours during the testing and debugging phase.
  • Specific orders like take profit, stop loss and trailing stop need to separated by an ampersand(&) allowing you to place multiple commands without duplicating multiple parameters.

Book

Default: b=all

Integrations: Global

Description: Specifies the order book to use for a trade, with "buy/sell" for spot and "long/short" for margin and futures.

Examples:

Open a long: s=eur/usd b=long

Open a short: s=eur/usd b=short

Cancel / Close

Default: c=n/a

Integrations: Global

Description: Used to either cancel open orders or close open positions. Specifying "order" cancels an order, while "position" closes a position.

Example:

Cancel all orders: s=eur/usd c=order

Cancel long orders: s=eur/usd c=order b=long

Cancel short orders: s=eur/usd c=order b=short

Close all positions: s=eur/usd c=position

Close long position: s=eur/usd c=position b=long

Close short position: s=eur/usd c=position b=short

Cancel/Close Maximum

Default: cm=all

Integrations: Global

Description: Specifies the number of orders to cancel or positions to close. Requires the 'c=' parameter in the command.

Example:

Cancel static amount of orders: s=eur/usd c=order cm=2

Cancel a percentage of orders: s=eur/usd c=order cm=2%

Cancel random range of static orders: s=eur/usd c=order cm=1-3%

Close static amount of positions: s=eur/usd c=position cm=2

Close a percentage of positions: s=eur/usd c=position cm=2%

Close random range of static positions: s=eur/usd c=position cm=1-3%

Cancel / Close Maximum Order

Default: cmo=oldest

Integrations: Global

Options: newest, oldest, lowest, highest, smallest, biggest, random

Description: Determines the order in which orders are cancelled or positions are closed. Requires the 'c=' parameter in the command.

Example:

Cancel newest orders first: s=eur/usd c=order cmo=newest

Close newest positions first: s=eur/usd c=position cmo=newest

Delay

Default: delay=0

Integrations: Global

Description: Introduces a pause between commands within the same alert, specified in seconds. Useful for timing the execution of sequential commands.

Example:

Delay the next command by 3 seconds: delay=3

Delay the next command by a random time between 1 and 9 seconds: delay=1-9

Disabled

Default:d=0

Integrations: Global

Description: Disables live action from a command, useful for debugging. "0" means disabled is off, allowing live actions, and "1" means disabled is on, preventing live actions.

Example:

Disable a short to see what Autoview will try to send to the exchange: s=eur/usd b=short d=1

Date/Time

Default: dt=YYYY-MM-DD

Integrations: Oanda

Description: Sets a specific date/time for the cancellation of an open order, formatted as year-month-day.

Example:

Set your order to cancel on October 12th 2024: s=eur/usd dt=1704742727.123456789 (seconds)

Fixed Guaranteed Stop Loss

Default: fgsl=n/a

Integrations: Oanda

Description: Sets a stop loss order with a fixed price threshold, guaranteed against slippage. Ensures a maximum loss limit on a position.

Example:

Set a guaranteed stop loss at the LOREM IPSUM LOREM IPSUM LOREM IPSUM: s=eur/usd fgsl=100

Fixed Price

Default: fp=n/a

Integrations: Global

Description: Specifies a fixed price for placing an order or closing a position, ensuring execution at a predetermined level.

Example:

Place your order at the exact price of $2,000: s=eur/usd fp=2000

Fixed Price Bound

Default: fpb=n/a

Integrations: Oanda

Description: Sets the worst market price acceptable for filling a Stop Order. If the market price gaps beyond this bound, the Stop Order is cancelled.

Example:

Set the worst market price at exactly $1,900: s=eur/usd fpb=1900

Fixed Stop Loss

Default: fsl=n/a

Integrations: Global

Description: Sets a stop loss order with a specific price trigger. The order is activated when the last traded price hits this stop price.

Example:

Place: s=eur/usd fsl=1800 t=market

Fixed Take Profit

Default: ftp=n/a

Integrations: Global

Description: Activates an order (buy or sell) when the last price reaches the set profit price, enabling targeted profit realization.

Example:

Example: s=eur/usd ftp=2100 t=market

Fixed Trailing Stop

Default: fts=n/a

Integrations: Global

Description: Establishes a trailing stop order with a fixed amount. The stop price adjusts or "trails" the market price by the specified amount.

Example:

Trail the current price by $100: s=eur/usd fts=100

Fixed Trigger Price

Default: fpx=n/a

Integrations: Global

Description: Sets a specific triegger price for stop limit orders. This price determines the activation point of the order.

Example:

Set your trigger price at exactly $2,300: s=eur/usd fpx=2300

Guaranteed Stop Loss

Default: gsl=n/a

Integrations: Oanda

Description: Creates a stop loss order with a price threshold based on a percentage, guaranteed against slippage. This ensures a maximum loss limit relative to the current price.

Example:

Set a guaranteed stop loss 5% above current price: s=eur/usd gsl=5%

Price

Default: p=0

Integrations: Global

Description: Sets the price of your order using a calculation. Specifies the amount to undercut or over-cut the top order in the book, expressed as a percentage of the current price or a static value.

Example:

Sets the price of 0.5% below the current price. s=eur/usd p=-0.5%

Sets the price of $10 above the current price. s=eur/usd p=10

Sets the price at a random value between $10 and $100 above the current price. s=eur/usd p=10-100

Sets the price at a random value between 1% and 10% above the current price. s=eur/usd p=1%-10%

Price Bound

Default: pb=n/a

Integrations: Oanda

Description: Sets the maximum acceptable market price for filling a stop order. If market conditions surpass this bound, the stop order is automatically cancelled.

Example:

Set the mzimum acceptable market price $100 above the current price:s=eur/usd pb=100

Price Source

Default: ps=top

Integrations: Global

Options: last, top, position

Description: Determines the reference for any price parameter calculations.

Example:

Use the last price for price calculations: s=eur/usd ps=last

Trigger Price

Default: px=n/a

Integrations: Global

Description: Sets a specific price for activating stop orders. The order is triggered when the market price reaches this specified level.

Example:

Set the trigger price of a stop-market order $100 above the current price: s=eur/usd px=100 t=market

Trigger Price Source

Default: pxs=last

Integrations: Global

Options: last, mark, index

Description: Specifies the reference for Trigger Price (px) calculations.

Example:

Uses the last price to set the trigger $100 above it: s=eur/usd pxs=last px=100 t=market

Quantity

Default: q=100%

Integrations: Global

Description: Defines the portion of the balance or position to be used in an order, specified as either a percentage or a fixed amount.

Example:

Place the order for 50% of your available balance: s=eur/usd q=50%

Place the order for a random value between 5% and 10% of your available balance: s=eur/usd q=5-10

Place the order for 5 contract : s=eur/usd q=5

Place the order for a random value between 5 and 10 contracts: s=eur/usd q=5-10

Reduce Only

Default: ro=0

Integrations: Global

Description: Ensures that an order can only reduce, not increase, a position. "0" disables this feature, allowing position increase, and "1" enables it, restricting to position reduction only.

Example:

Sets the order as reduce only ensuring it does not open a new position: s=eur/usd q=1 t=market ro=1

Symbol

Default: s=Provided by Tradingview via the alert

Integrations: Global

Description: Specifies the market symbol for the command in the format recognized by the selected exchange.

Example:

Place this command on the EUR/USD market:s=eus/usd

Stop Loss

Default: sl=n/a

Integrations: Global

Description: Sets a stop loss order at a specific price, triggering a buy or sell order when the last traded price reaches this level.

Example:

Enter a new order with the stop loss attached: s=eur/usd q=1 t=market & sl=100

Add a stop loss to your existing position based on that positions average price: s=eur/usd c=position ps=position & sl=100

Order Type

Default: t=limit

Integrations: Global

Options: limit, market, fok, ioc, post, close, open, settle, stop

Description: Defines the type of the order.

Example:

Enter this order at the market price: s=eur/usd t=market

Take Profit

Default: tp=n/a

Integrations: Global

Description: Sets a take profit order at a specified price, triggering a buy or sell order when the last traded price reaches this level for profit realization.

Example:

Enter a new order with the take profit attached: s=eur/usd q=1 t=market & tp=100

Add a take profit to your existing position based on that positions average price: s=eur/usd c=position ps=position & tp=200

Testing

Default: testing=0

Integrations: Global

Description: When enabled, it prevents any live action from a command, useful for debugging purposes. "0" deactivates testing mode, allowing live actions, and "1" activates it, preventing live actions.

Example:

Enable testing mode for all following commands: s=eur/usd testing=1

Trailing Stop

Default: ts=n/a

Integrations: Global

Description: Sets a trailing stop order that adjusts the stop price by a specified amount following the market price, offering dynamic risk management.

Example:

Enter a new order with the trailing stop attached: s=eur/usd q=1 t=market & tp=100

Add a trailing stop to your existing position based on that positions average price: s=eur/usd c=position ps=position & ts=200

Unit

Default: u=contracts

Integrations: Global

Description: Specifies the unit of the quantity (q) being provided for the order

Options: contracts, currency

Example:

Open an order worth $10: s=eur/usd u=currency q=10

Yield

Default: y=balance

Integrations: Global

Options: balance, equity, margin, spot, borrow, repay, futures, delivery, spot-futures, spot-delivery, contract, investment, spot-contract, spot-investment

Description: Sets the type of balance to be used for the command.

Example:

Place an order for 10% of your accounts full equity (including position(s) PnL): s=eur/usd b=long q=10% t=market y=equity

Command Examples

Open a new long order for 10% of your balance at market

s=eur/usd b=long q=10% t=market

Open a new short order 1% higher than the current price for 10 contracts

s=eur/usd b=short q=10 p=1%

Open a new short stop market order 1% below the current price

s=eur/usd b=short px=-1% t=market

Open a new long stop at a specific trigger price and order price

s=eur/usd b=long fpx=1.09 fp=1.0895

Open a new order for 1 contract at market price with a take profit, stop loss and trailing stop at at specific prices.

e=eur/usd b=long q=1 t=market & ftp=1.098 fsl=1.0678 fts=0.01

Add a take profit, stop loss and trailing stop to an existing long position

s=eur/usd b=long c=position ps=position & tp=3% sl=-3% ts=-4%

© 2024 Autoview