Package org.knowm.xchange.dto.trade
Class MarketOrder
java.lang.Object
org.knowm.xchange.dto.Order
org.knowm.xchange.dto.trade.MarketOrder
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
HitbtcMarketOrder
DTO representing a market order
A market order is a buy or sell order to be executed immediately at current market prices. As
long as there are willing sellers and buyers, market orders are filled. Market orders are
therefore used when certainty of execution is a priority over price of execution. Use
market orders with caution, and review LimitOrder
in case it is more suitable.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.knowm.xchange.dto.Order
Order.IOrderFlags, Order.OrderStatus, Order.OrderType
-
Constructor Summary
ConstructorsConstructorDescriptionMarketOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument) MarketOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp) MarketOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal averagePrice, BigDecimal cumulativeAmount, BigDecimal fee, Order.OrderStatus status) MarketOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, BigDecimal averagePrice, BigDecimal cumulativeAmount, BigDecimal fee, Order.OrderStatus status, String userReference) MarketOrder
(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, Date timestamp) -
Method Summary
Methods inherited from class org.knowm.xchange.dto.Order
addOrderFlag, equals, getAveragePrice, getCumulativeAmount, getCumulativeCounterAmount, getCurrencyPair, getFee, getId, getInstrument, getLeverage, getOrderFlags, getOriginalAmount, getRemainingAmount, getStatus, getTimestamp, getType, getUserReference, hasFlag, hashCode, setAveragePrice, setCumulativeAmount, setFee, setLeverage, setOrderFlags, setOrderStatus, toString
-
Constructor Details
-
MarketOrder
public MarketOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, 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 providedaveragePrice
- 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
-
MarketOrder
public MarketOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp, 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 providedaveragePrice
- 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
-
MarketOrder
public MarketOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, String id, Date timestamp) - 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
- the absolute time for this order
-
MarketOrder
public MarketOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument, Date timestamp) - Parameters:
type
- Either BID (buying) or ASK (selling)originalAmount
- The amount to tradeinstrument
- The identifier (e.g. BTC/USD)timestamp
- the absolute time for this order
-
MarketOrder
- Parameters:
type
- Either BID (buying) or ASK (selling)originalAmount
- The amount to tradeinstrument
- The identifier (e.g. BTC/USD)
-