Description Usage Arguments Details Value See Also Examples
submit an order with timeout checking. The order will be canceled when it hasn't been executed for a duration longer than timeoutsleep
1 2 | timeoutsubmission(instrumentid = "qtid", orderid = NULL, direction = 1,
price = 0, hands = 1, action = "open", timeoutsleep = 1)
|
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. |
timeoutsubmission is a wrapper of ordersubmission, it act the same as ordersubmission(...,timeoutlist=TRUE,chaselist=FALSE)
order status code.
multisubmission timeoutchasesubmission ordersubmission chasesubmission
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.