dot-rp_make_multileg_payload: Build Multi-Leg Order Payload (Internal)

.rp_make_multileg_payloadR Documentation

Build Multi-Leg Order Payload (Internal)

Description

Build Multi-Leg Order Payload (Internal)

Usage

.rp_make_multileg_payload(
  orderType,
  qty,
  orderId = NULL,
  leg_symbols,
  leg_types,
  leg_sides,
  leg_indicator,
  leg_ratios,
  lmtPrc = NULL,
  tif,
  expTime = NULL
)

Arguments

orderType

= (string) The Type of order: 'MARKET', 'LIMIT', 'STOP', 'STOP_LIMIT'

qty

= (string) leg_ratio multiple: ex. '2' multiples the leg_ratios by 2X

orderId

= (string) The order ID

leg_symbols

= (string) Symbols: ex. c("SPY250815C00631000", "SPY250815C00631000")

leg_types

= (string) Symbol types: ex. c("OPTION", "OPTION")

leg_sides

= (string) The side for each leg: ex. c("BUY", "SELL")

leg_indicator

= (string) Indicates if this is BUY to OPEN/CLOSE ex. c("OPEN", "OPEN")

leg_ratios

= (string) The number of contracts to BUY/SELL: ex. c('5','5')

lmtPrc

= (string) The limit price. Used when orderType = LIMIT or orderType = STOP_LIMIT

tif

= (string) The time in for the order: 'DAY' or 'GTD"

expTime

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

Value

Returns an appropriate payload list for a multiple-leg order

Examples

## Not run: 
  # Return the proper order payload for multiple-leg orders
  .rp_make_multileg_payload(orderType="LIMIT", qty="2", orderId=rp_getOrderId(), 
                            leg_symbols = c("SPY250815C00631000", "SPY250815C00631000"), 
                            leg_types = c("OPTION", "OPTION"), leg_sides = c("BUY", "SELL"), 
                            leg_indicator = c("OPEN", "OPEN"), leg_ratios=c('5','5'), 
                            lmtPrc='0.25', tif="DAY")

## End(Not run)

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