Package org.knowm.xchange.dto.trade
Class LimitOrder
java.lang.Object
org.knowm.xchange.dto.Order
org.knowm.xchange.dto.trade.LimitOrder
- All Implemented Interfaces:
Serializable
,Comparable<LimitOrder>
- Direct Known Subclasses:
BitfinexLimitOrder
,CexioOrder
,GeminiLimitOrder
,HitbtcLimitOrder
,PoloniexLimitOrder
,RippleLimitOrder
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.knowm.xchange.dto.Order
Order.IOrderFlags, Order.OrderStatus, Order.OrderType
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLimitOrder
(Order.OrderType type, BigDecimal originalAmount, BigDecimal cumulativeAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice) LimitOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice) LimitOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice, BigDecimal averagePrice, BigDecimal cumulativeAmount, BigDecimal fee, Order.OrderStatus status) LimitOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice, BigDecimal averagePrice, BigDecimal cumulativeAmount, BigDecimal fee, Order.OrderStatus status, String userReference) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(LimitOrder limitOrder) boolean
int
hashCode()
toString()
Methods inherited from class org.knowm.xchange.dto.Order
addOrderFlag, getAveragePrice, getCumulativeAmount, getCumulativeCounterAmount, getCurrencyPair, getFee, getId, getInstrument, getLeverage, getOrderFlags, getOriginalAmount, getRemainingAmount, getStatus, getTimestamp, getType, getUserReference, hasFlag, setAveragePrice, setCumulativeAmount, setFee, setLeverage, setOrderFlags, setOrderStatus
-
Field Details
-
limitPrice
The limit price
-
-
Constructor Details
-
LimitOrder
public LimitOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice) - Parameters:
type
- Either BID (buying) or ASK (selling)originalAmount
- The amount to tradeinstrument
- 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 price
-
LimitOrder
public LimitOrder(Order.OrderType type, BigDecimal originalAmount, BigDecimal cumulativeAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice) - Parameters:
type
- Either BID (buying) or ASK (selling)originalAmount
- The amount to tradecumulativeAmount
- The cumulative amountinstrument
- 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 price
-
LimitOrder
public LimitOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice, BigDecimal averagePrice, BigDecimal cumulativeAmount, BigDecimal fee, Order.OrderStatus status) - Parameters:
type
- Either BID (buying) or ASK (selling)originalAmount
- The amount to tradeinstrument
- 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 priceaveragePrice
- the weighted average price of any fills belonging to the ordercumulativeAmount
- the amount that has been filledfee
- the fee associated with this orderstatus
- the status of the order at the exchange or broker
-
LimitOrder
public LimitOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal limitPrice, BigDecimal averagePrice, BigDecimal cumulativeAmount, BigDecimal fee, Order.OrderStatus status, String userReference) - Parameters:
type
- Either BID (buying) or ASK (selling)originalAmount
- The amount to tradeinstrument
- 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 priceaveragePrice
- the weighted average price of any fills belonging to the ordercumulativeAmount
- the amount that has been filledstatus
- the status of the order at the exchange or brokeruserReference
- An id provided by the user
-
-
Method Details
-
getLimitPrice
- Returns:
- The limit price
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<LimitOrder>
-
hashCode
public int hashCode() -
equals
-