timeoutsubmission: timeoutsubmission

Description Usage Arguments Details Value See Also Examples

Description

submit an order with timeout checking. The order will be canceled when it hasn't been executed for a duration longer than timeoutsleep

Usage

1
2
timeoutsubmission(instrumentid = "qtid", orderid = NULL, direction = 1,
  price = 0, hands = 1, action = "open", timeoutsleep = 1)

Arguments

instrumentid

character, instrument identifier.

orderid

character, specifying an unique order id, can be generated by randomid().

direction

integer, specifying trading direction. 1 for long, -1 for short.

price

numeric, specifiying order pirce.NOTE: when price=0, ordersubmission() will submit a market order; when price=NULL, ordersubmission() will take the corresponding bid1 or ask1 price as submitted price.

hands

integer, specifying amount to be submitted.

action

character, specifying submit action, action can take value from one of "open","close","closetoday","closepreday" and "cancel". amount submitted in action='close' can not be greater than the sum of current holdings and queuing open hands.

timeoutsleep

numeric, specifying the timeout inverval in seconds.

Details

timeoutsubmission is a wrapper of ordersubmission, it act the same as ordersubmission(...,timeoutlist=TRUE,chaselist=FALSE)

Value

order status code.

See Also

multisubmission timeoutchasesubmission ordersubmission chasesubmission

Examples

1
2
3
4
5
6
7
8
## Not run: 
## submit an open order, buy 1 hand of TF1603 at price 99
## cancel the order if it's not executed in the next 10 seconds
timeoutsubmission(instrumentid="TF1603",orderid=randomid(5),
                direction=1,price=99,hands=1,action="open".
                timeoutsleep=10)

## End(Not run)

chenhaotian/High-Frequency-Trading-Simulation-System documentation built on May 13, 2019, 3:52 p.m.