rp_order_single: Single-Leg Live Order

View source: R/rPublic.R

rp_order_singleR Documentation

Single-Leg Live Order

Description

Single-Leg Live Order

Usage

rp_order_single(
  accountId,
  ticker,
  symType,
  orderId,
  side = NULL,
  ordType = NULL,
  timeInForce = NULL,
  expirationTime = NULL,
  qty = NULL,
  amt = NULL,
  lmtPrc = NULL,
  stopPrc = NULL,
  openCloseIndicator = NULL
)

Arguments

accountId

= Public Brokerage Account Number

ticker

= Ticker symbol: Ex. "SPY"

symType

= Ticker Type: Ex. 'EQUITY','OPTION','MULTI_LEG_INSTRUMENT', 'CRYPTO', 'ALT','TREASURY', 'BOND', 'INDEX'

orderId

= The order ID: use rp_getOrderId()

side

= The Order Side BUY/SELL. For Options also include the openCloseIndicator. Ex. 'BUY' OR 'SELL'

ordType

= The Type of order: Ex. 'MARKET','LIMIT', 'STOP', 'STOP_LIMIT'

timeInForce

= The time in for the order: Ex. 'DAY' OR 'GTD"

expirationTime

= The expiration date. Only used when timeInForce is GTD, cannot be more than 90 days in the future

qty

= The order quantity. Used when buying/selling whole shares and when selling fractional. Mutually exclusive with amount

amt

= The order amount. Used when buying/selling shares for a specific notional value

lmtPrc

= The limit price. Used when orderType = LIMIT or orderType = STOP_LIMIT

stopPrc

= The stop price. Used when orderType = STOP or orderType = STOP_LIMIT

openCloseIndicator

= Used for options only. Indicates if this is BUY to OPEN/CLOSE

Value

Submit a live single-leg order and and returns the order ID as a data.frame.

Examples

## Not run: 
 # Submit a live single-leg order to your Public Brokerage Account
 my_acc <- rp_getAccts() 
 
 # Option Order
 rp_order_singleLeg(accountId = my_acc$accountId, ticker = "SPY250815C00633000", symType = "OPTION", 
                    orderId = rp_getOrderId(), side = "BUY", ordType = "LIMIT", lmtPrc = 1.50, 
                    timeInForce = "DAY", qty = 1, openCloseIndicator = "OPEN")
               
 # Equity Fraction Share Order                   
 rp_preOrder_singleLeg(accountId = my_acc$accountId, ticker = "TSLA", symType = "EQUITY", 
                       side = "BUY", ordType = "MARKET", timeInForce = "DAY", qty = 0.50,
                       openCloseIndicator = "OPEN")

## End(Not run)

rPublic documentation built on Aug. 23, 2025, 1:12 a.m.