osMaxPos: order sizing function for position limits and level sizing

Description Usage Arguments Details Note See Also

View source: R/osFUNs.R

Description

levels are a simplification of more complex (proprietary) techniques sometimes used for order sizing. the max orderqty returned will be the limit/levels Obviously the strategy rules could ask for smaller order sizes, but this is the default. If you don't want to use levels, set them to 1.

Usage

1
2
osMaxPos(data, timestamp, orderqty, ordertype, orderside, portfolio, symbol,
  ruletype, ...)

Arguments

data

an xts object containing market data. depending on rules, may need to be in OHLCV or BBO formats, and may include indicator and signal information

timestamp

timestamp coercible to POSIXct that will be the time the order will be inserted on

orderqty

numeric quantity of the desired order, modified by osFUN

ordertype

one of "market","limit","stoplimit", or "stoptrailing"

orderside

one of either "long" or "short"

portfolio

text name of the portfolio to place orders in

symbol

identifier of the instrument to place orders for. The name of any associated price objects (xts prices, usually OHLC) should match these

ruletype

one of "risk","order","rebalance","exit","enter", see add.rule

...

any other passthru parameters

Details

orderqty='all' in a risk rule will return an order size appropriate to flatten the current position.

Note

TODO integrate orderqty='all' into osMaxPos for non-risk exit orders by combining side and pos for exits

See Also

addPosLimit,getPosLimit


cloudcell/quantstrat documentation built on May 13, 2019, 8:03 p.m.