public class Order
Specify
Modifier and Type | Field and Description |
---|---|
static plham.Order.Kind |
KIND_BUY_LIMIT_ORDER
Field Type: plham.Order.Kind{self.id==3L}
|
static plham.Order.Kind |
KIND_BUY_MARKET_ORDER
Field Type: plham.Order.Kind{self.id==1L}
|
static plham.Order.Kind |
KIND_SELL_LIMIT_ORDER
Field Type: plham.Order.Kind{self.id==4L}
|
static plham.Order.Kind |
KIND_SELL_MARKET_ORDER
Field Type: plham.Order.Kind{self.id==2L}
|
static Double |
NO_PRICE
Field Type: Double{self==Double.MAX_VALUE}
Use if a market order
|
Long |
agentId |
plham.Order.Kind |
kind |
Long |
marketId |
Long |
orderId
The order id used for consulting and to notify its execution (set to 0 if unnecessary; this is by default).
|
Double |
price |
Long |
timeLength
The relative term until the expiry time (due time).
|
Long |
timePlaced
The time when this order is placed.
|
Long |
volume |
Constructor and Description |
---|
Order(plham.Order.Kind kind,
Long agentId,
Long marketId,
Double price,
Long volume,
Long timeLength,
Long timePlaced,
Long orderId)
Do not use this.
|
Order(plham.Order.Kind kind,
Long agentId,
Long marketId,
Double price,
Long volume,
Long timeLength,
Long timePlaced)
Do not use this.
|
Order(plham.Order.Kind kind,
Agent agent,
Market market,
Double price,
Long volume,
Long timeLength) |
Order(Order other)
Create a copy.
|
Modifier and Type | Method and Description |
---|---|
String |
getKindName() |
Double |
getPrice() |
Long |
getVolume() |
Boolean |
isBuyOrder() |
Boolean |
isCancel()
Test if this is a cancel request for an order.
|
Boolean |
isExpired(Market market)
Test if this order has been expired.
|
Boolean |
isExpired(Long t)
Test if this order has been expired.
|
Boolean |
isLimitOrder() |
Boolean |
isMarketOrder() |
Boolean |
isSellOrder() |
Double |
setPrice(Double price) |
Long |
setVolume(Long volume) |
String |
toString() |
void |
updateVolume(Long delta)
Update the volume of this order by adding
delta . |
public static final plham.Order.Kind KIND_BUY_MARKET_ORDER
public static final plham.Order.Kind KIND_SELL_MARKET_ORDER
public static final plham.Order.Kind KIND_BUY_LIMIT_ORDER
public static final plham.Order.Kind KIND_SELL_LIMIT_ORDER
public static final Double NO_PRICE
Use if a market order
public plham.Order.Kind kind
public Long agentId
public Long marketId
public Double price
public Long volume
public Long timeLength
public Long timePlaced
market.getTime()
.public Long orderId
public Order(plham.Order.Kind kind, Long agentId, Long marketId, Double price, Long volume, Long timeLength, Long timePlaced, Long orderId)
public Order(plham.Order.Kind kind, Long agentId, Long marketId, Double price, Long volume, Long timeLength, Long timePlaced)
public Order(plham.Order.Kind kind, Agent agent, Market market, Double price, Long volume, Long timeLength)
public Order(Order other)
public Double getPrice()
public Double setPrice(Double price)
public Long getVolume()
public Long setVolume(Long volume)
public void updateVolume(Long delta)
delta
.public Boolean isBuyOrder()
public Boolean isSellOrder()
public Boolean isLimitOrder()
public Boolean isMarketOrder()
public Boolean isCancel()
Cancel
public Boolean isExpired(Market market)
market
- public Boolean isExpired(Long t)
t
- public String toString()
public String getKindName()