public class Market extends Object
Constructor and Description |
---|
Market(MarketListener listener)
Create a market.
|
Modifier and Type | Method and Description |
---|---|
void |
add(long instrument,
long orderId,
Side side,
long price,
long size)
Add an order to an order book.
|
long |
cancel(long orderId,
long quantity)
Cancel a quantity of an order in an order book.
|
void |
delete(long orderId)
Delete an order from an order book.
|
long |
execute(long orderId,
long quantity)
Execute a quantity of an order in an order book.
|
long |
execute(long orderId,
long quantity,
long price)
Execute a quantity of an order in an order book.
|
Order |
find(long orderId)
Find an order.
|
void |
modify(long orderId,
long size)
Modify an order in an order book.
|
OrderBook |
open(long instrument)
Open an order book.
|
public Market(MarketListener listener)
listener
- a listener for outbound events from the marketpublic OrderBook open(long instrument)
If the order book for the instrument is already open, do nothing.
instrument
- an instrumentpublic Order find(long orderId)
orderId
- the order identifiernull
if the order identifier is unknownpublic void add(long instrument, long orderId, Side side, long price, long size)
An update event is triggered.
If the order book for the instrument is closed or the order identifier is known, do nothing.
instrument
- the instrumentorderId
- the order identifierside
- the sideprice
- the pricesize
- the sizepublic void modify(long orderId, long size)
An update event is triggered.
If the order identifier is unknown, do nothing.
orderId
- the order identifiersize
- the new sizepublic long execute(long orderId, long quantity)
A Trade event and an update event are triggered.
If the order identifier is unknown, do nothing.
orderId
- the order identifierquantity
- the executed quantitypublic long execute(long orderId, long quantity, long price)
A Trade event and an update event are triggered.
If the order identifier is unknown, do nothing.
orderId
- the order identifierquantity
- the executed quantityprice
- the execution pricepublic long cancel(long orderId, long quantity)
An update event is triggered if the top of the book changes.
If the order identifier is unknown, do nothing.
orderId
- the order identifierquantity
- the canceled quantitypublic void delete(long orderId)
An update event is triggered if the top of the book changes.
If the order identifier is unknown, do nothing.
orderId
- the order identifierCopyright © 2017. All rights reserved.