timeoutchasesubmission: timeoutchasesubmission

Description Usage Arguments Details Value See Also Examples

View source: R/hftsimulator.r

Description

submit an order with timeout checking, chase bid1 or ask1. price to execute it when timeout. type ?ordersumission, ?timeoutsubmission and ?chasesubmission for more information.

Usage

1
2
3
timeoutchasesubmission(instrumentid = "qtid", orderid = NULL,
  direction = 1, price = 0, hands = 1, action = "open",
  timeoutsleep = 1, chasesleep = 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.

chasesleep

numeric, specifying the time interval between each execution check. In seconds.

Details

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

Value

order status code.

See Also

multisubmission ordersubmission timeoutsubmission chasesubmission

Examples

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

## End(Not run)

chenhaotian/High-Frequency-Trading-Simulation-System documentation built on April 18, 2018, 9:24 p.m.