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:
DsxMarketOrder
,HitbtcMarketOrder
public class MarketOrder extends Order
DTO representing a market orderA 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MarketOrder.Builder
-
Nested classes/interfaces inherited from class org.knowm.xchange.dto.Order
Order.IOrderFlags, Order.OrderStatus, Order.OrderType
-
-
Constructor Summary
Constructors Constructor Description MarketOrder(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 Detail
-
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
public MarketOrder(Order.OrderType type, BigDecimal originalAmount, Instrument instrument)
- Parameters:
type
- Either BID (buying) or ASK (selling)originalAmount
- The amount to tradeinstrument
- The identifier (e.g. BTC/USD)
-
-