Description Usage Arguments Details Value Examples
Modify the order book.
1 2 3 4 5 | add.order(object, price, size, type, time = NULL, id = NULL, status =
FALSE)
remove.order(object, id)
replace.order(object, id, size)
market.order(object, size, type)
|
object |
Object of class |
price |
of the order to be added. |
size |
the size of the order to
be added. In the case of a |
type |
the user can specify "bid" or "ask." For a |
time |
of the order. If no time is specified the order book will automatically add 1000ms to the current time for the new order. |
id |
of the order. It must be unique. If no ID is specfied then |
status |
indicating whether or not the order belongs to the user. |
The user can add, remove, and replace orders from the order book. Additionally, the user can issue market orders. These functions are useful for simulating an order book.
Return an object of class orderbook
1 2 3 4 5 6 7 8 9 10 | library(orderbook)
filename <- system.file("extdata", "sample.txt",
package = "orderbook")
ob <- orderbook(file = filename)
ob <- add.order(ob, price = 123, size = 123, type = "BID", time = 1, id = 1)
ob <- replace.order(ob, 1, 100)
ob <- market.order(ob, 50, "SELL")
ob <- remove.order(ob, 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.