public class LimitOrder extends Order implements Comparable<LimitOrder>
DTO representing a limit order
A limit order lets you set a minimum or maximum price before your trade will be treated by the exchange as a MarketOrder
. There is no
guarantee that your conditions will be met on the exchange, so your order may not be executed. However, until you become very experienced, almost
all orders should be limit orders to protect yourself.
Modifier and Type | Class and Description |
---|---|
static class |
LimitOrder.Builder |
Order.IOrderFlags, Order.OrderType
Modifier and Type | Field and Description |
---|---|
protected BigDecimal |
limitPrice
The limit price
|
Constructor and Description |
---|
LimitOrder(Order.OrderType type,
BigDecimal tradableAmount,
CurrencyPair currencyPair,
String id,
Date timestamp,
BigDecimal limitPrice) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(LimitOrder limitOrder) |
boolean |
equals(Object obj) |
BigDecimal |
getLimitPrice() |
int |
hashCode() |
String |
toString() |
addOrderFlag, getCurrencyPair, getId, getOrderFlags, getTimestamp, getTradableAmount, getType, setOrderFlags
protected final BigDecimal limitPrice
public LimitOrder(Order.OrderType type, BigDecimal tradableAmount, CurrencyPair currencyPair, String id, Date timestamp, BigDecimal limitPrice)
type
- Either BID (buying) or ASK (selling)tradableAmount
- The amount to tradecurrencyPair
- The identifier (e.g. BTC/USD)id
- An id (usually provided by the exchange)timestamp
- a Date object representing the order's timestamp according to the exchange's server, null if not providedlimitPrice
- In a BID this is the highest acceptable price, in an ASK this is the lowest acceptable pricepublic BigDecimal getLimitPrice()
public int compareTo(LimitOrder limitOrder)
compareTo
in interface Comparable<LimitOrder>
Copyright © 2012–2016 Xeiam, LLC. All rights reserved.