rp_preOrder_singleLeg: Preflight Single-Leg

View source: R/rPublic.R

rp_preOrder_singleLegR Documentation

Preflight Single-Leg

Description

Preflight Single-Leg

Usage

rp_preOrder_singleLeg(
  accountId,
  ticker,
  symType,
  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'

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

Calculates the estimated financial impact of a potential trade before execution and returns as a data.frame.

Examples

## Not run: 
 # Fetches costs associated with the type of order being placed
 my_acc <- rp_getAccts()
 rp_preOrder_singleLeg(accountId = my_acc$accountId, ticker = "SPY250815C00633000", 
                       symType = "OPTION", side = "BUY", ordType = "MARKET", 
                       timeInForce = "DAY", qty = 1, openCloseIndicator = "OPEN")

 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.