[Maturing] The method trading_new_order is use to send orders.

trading_new_order(
  connection,
  account,
  symbol,
  side,
  quantity,
  price,
  order_type = "Limit",
  time_in_force = "Day",
  iceberg = FALSE,
  expire_date = NULL,
  display_quantity = NULL,
  cancel_previous = FALSE
)

Arguments

connection

S4. Mandatory Formal rRofexConnection class object

account

String. Mandatory Account Number

symbol

String. Use trading_instruments to see which symbols are available.

side

String. Mandatory Either:

  • Buy

  • Sell

quantity

Numeric. Mandatory Quantity of the order.

price

Numeric. Mandatory Price of the order.

order_type

String. Type of order.

  • Limit - Default. Limit order sets the maximum or minimum price at which you are willing to buy or sell.

time_in_force

String. Specifies how long the order remains in effect. Absence of this field is interpreted as 'Day':

  • Day - Day or session.

  • IOC - Immediate or Cancel.

  • FOK - Fill or Kill.

  • GTD - Good Till Date.

iceberg

Logical. If TRUE, then the order is 'iceberg'. FALSE as default.

expire_date

String. Only for GDT orders. Maturity date of the order, With format '%Y-%m-%d'.

display_quantity

Numeric. Only for Iceberg orders. Indicate the disclosed quantity for the 'iceberg' order.

cancel_previous

Logigal. Optional parameter only valid for Matba Rofex instruments. By default it's FALSE.

Value

If correct, it will load a tibble.

See also

Other order placements functions: trading_cancel_order()