chasesubmission: chasesubmission

Description Usage Arguments Details Value See Also Examples

View source: R/hftsimulator.r

Description

chase bid1 or ask1. after every 'chasesleep' seconds, simulator will check wether current order's price equals to bid1 or ask1 price, if not, order chaser will replace it with a new one satisfying the price condition.

Usage

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

chasesleep

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

Details

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

Value

order status code.

See Also

multisubmission timeoutchasesubmission ordersubmission chasesubmission

Examples

1
2
3
4
5
6
7
8
9
## 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 10 seconds
## recheck the price condition  every 10 seconds.
chasesubmission(instrumentid="TF1603",orderid=randomid(5),
                direction=1,price=99,hands=1,action="open".
                chasesleep=10)

## End(Not run)

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