place_order: Place Order

View source: R/place_order.R

place_orderR Documentation

Place Order

Description

Sends an order to IB's servers to buy or sell a financial instrument.

Usage

place_order(
  contract,
  order,
  deltaNeutralContract = NULL,
  softDollarTier = NULL,
  channel = NULL,
  non_master_override = TRUE
)

Arguments

contract

Named character vector of contract parameter(s). The name of each element identifies the parameter – for example, secType, symbol, exchange... – and each element itself gives the set value (e.g., "STK", "IBM", "SMART").

The 'contract' parameters that may be used with place_order() are:
deltaNeutralContract, secId, conId, comboLegs, secType, tradingClass, symbol, lastTradeDateOrContractMonth, strike, right, multiplier, exchange, primaryExchange, currency, localSymbol, secIdType

See contract for detailed information on all contract parameters.

order

describe that

deltaNeutralContract

that too

softDollarTier

and that

channel

One of the following:

  • Not Specified (Default): Opens a new connection to IB, uses it to issue the request and retrieve the response, and closes connection behind itself upon completion.

  • The Name of a Sock: Character vector, length 1. The name of an open, connected socket in the sock_drawer; e.g., "master", "tws", or "sock_123"

  • Numeric Client ID: Numeric, length 1. The client ID for which open orders are to be retrieved; e.g., 0, 874, 123. If a client ID is passed, and no socket in the sock_drawer is connected on that ID, then a new socket will be opened on that ID, and closed upon function exit.

  • A sockconn Connection: An open connection object of class "sockconn", connected to the IB API; e.g., sock_drawer$tws

non_master_override

finally that

Conditional Orders

Conditional Orders

Bracket Orders

Bracket Orders

Attaching (Hedging) Orders

See Also

Other orders: cancel_order(), req_all_open_orders(), req_auto_open_orders(), req_completed_orders(), req_ids(), req_open_orders()


JakeVestal/InteractiveTradeR documentation built on June 5, 2024, 2:21 p.m.