.rp_make_multileg_payload | R Documentation |
Build Multi-Leg Order Payload (Internal)
.rp_make_multileg_payload(
orderType,
qty,
orderId = NULL,
leg_symbols,
leg_types,
leg_sides,
leg_indicator,
leg_ratios,
lmtPrc = NULL,
tif,
expTime = NULL
)
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 |
Returns an appropriate payload list
for a multiple-leg order
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.