Class Order
java.lang.Object
markets.alpaca.client.openapi.broker.model.Order
- All Implemented Interfaces:
Serializable
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class Order
extends Object
implements Serializable
Order
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLegsItem(OrderLeg legsItem) assetClass(AssetClass assetClass) canceledAt(OffsetDateTime canceledAt) cancelRequestedAt(OffsetDateTime cancelRequestedAt) clientOrderId(String clientOrderId) commission(BigDecimal commission) commissionBps(BigDecimal commissionBps) Deprecated.commissionType(CommissionType commissionType) createdAt(OffsetDateTime createdAt) booleanexpiredAt(OffsetDateTime expiredAt) extendedHours(Boolean extendedHours) failedAt(OffsetDateTime failedAt) filledAt(OffsetDateTime filledAt) filledAvgPrice(BigDecimal filledAvgPrice) filledQty(BigDecimal filledQty) static OrderCreate an instance of Order given an JSON stringReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.Get assetClassThe asset ID (For options this represents the option contract ID)Can be nullTime when cancellation or bust was requested (if applicable)Client unique order IDThe dollar value commission for this order.Deprecated.Get commissionTypeTime when order was enteredCan be nullGet extendedHoursCan be nullTime the order was filled.Filled average price.Filled quantitygetHwm()The highest (lowest) market price seen since the trailing stop order was submitted.getId()Order ID generated by AlpacagetLegs()When querying non-simple order_class orders in a nested style, an array of Order entities associated with this order.Limit priceOrdered notional amount.Get orderClassGet orderTypeGet positionIntentgetQty()Ordered quantity.Can be nullThe order ID that this order was replaced by.The order ID that this order replaces.getSide()Get sideGet statusStop priceTime the order was submitted for execution or, if not yet submitted the created_at time.Fee in basis points on top swap rate charged by the correspondent on every orderSwap rate is the exchange rate (without mark-up) used to convert the price into local currency or crypto assetThe asset symbolGet timeInForceThe percent value away from the high water mark for trailing stop orders.The dollar value away from the high water mark for trailing stop orders.getType()Get typeTime of most recent change to the ordergetUsd()Nested object to encompass the USD equivalent fields for the local currency fieldsinthashCode()hwm(BigDecimal hwm) limitPrice(BigDecimal limitPrice) notional(BigDecimal notional) orderClass(OrderClass orderClass) positionIntent(PositionIntent positionIntent) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.qty(BigDecimal qty) replacedAt(OffsetDateTime replacedAt) replacedBy(UUID replacedBy) voidsetAssetClass(AssetClass assetClass) voidsetAssetId(UUID assetId) voidsetCanceledAt(OffsetDateTime canceledAt) voidsetCancelRequestedAt(OffsetDateTime cancelRequestedAt) voidsetClientOrderId(String clientOrderId) voidsetCommission(BigDecimal commission) voidsetCommissionBps(BigDecimal commissionBps) Deprecated.voidsetCommissionType(CommissionType commissionType) voidsetCreatedAt(OffsetDateTime createdAt) voidsetExpiredAt(OffsetDateTime expiredAt) voidsetExtendedHours(Boolean extendedHours) voidsetFailedAt(OffsetDateTime failedAt) voidsetFilledAt(OffsetDateTime filledAt) voidsetFilledAvgPrice(BigDecimal filledAvgPrice) voidsetFilledQty(BigDecimal filledQty) voidsetHwm(BigDecimal hwm) voidvoidvoidsetLimitPrice(BigDecimal limitPrice) voidsetNotional(BigDecimal notional) voidsetOrderClass(OrderClass orderClass) voidsetOrderType(OrderType orderType) voidsetPositionIntent(PositionIntent positionIntent) voidsetQty(BigDecimal qty) voidsetReplacedAt(OffsetDateTime replacedAt) voidsetReplacedBy(UUID replacedBy) voidsetReplaces(UUID replaces) voidvoidsetStatus(OrderStatus status) voidsetStopPrice(BigDecimal stopPrice) voidsetSubmittedAt(OffsetDateTime submittedAt) voidsetSwapFeeBps(String swapFeeBps) voidsetSwapRate(String swapRate) voidvoidsetTimeInForce(TimeInForce timeInForce) voidsetTrailPercent(BigDecimal trailPercent) voidsetTrailPrice(BigDecimal trailPrice) voidvoidsetUpdatedAt(OffsetDateTime updatedAt) voidstatus(OrderStatus status) stopPrice(BigDecimal stopPrice) submittedAt(OffsetDateTime submittedAt) swapFeeBps(String swapFeeBps) timeInForce(TimeInForce timeInForce) toJson()Convert an instance of Order to an JSON stringtoString()trailPercent(BigDecimal trailPercent) trailPrice(BigDecimal trailPrice) updatedAt(OffsetDateTime updatedAt) static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_ASSET_CLASS
- See Also:
-
SERIALIZED_NAME_ASSET_ID
- See Also:
-
SERIALIZED_NAME_CANCEL_REQUESTED_AT
- See Also:
-
SERIALIZED_NAME_CANCELED_AT
- See Also:
-
SERIALIZED_NAME_CLIENT_ORDER_ID
- See Also:
-
SERIALIZED_NAME_COMMISSION
- See Also:
-
SERIALIZED_NAME_COMMISSION_BPS
- See Also:
-
SERIALIZED_NAME_COMMISSION_TYPE
- See Also:
-
SERIALIZED_NAME_CREATED_AT
- See Also:
-
SERIALIZED_NAME_EXPIRED_AT
- See Also:
-
SERIALIZED_NAME_EXTENDED_HOURS
- See Also:
-
SERIALIZED_NAME_FAILED_AT
- See Also:
-
SERIALIZED_NAME_FILLED_AT
- See Also:
-
SERIALIZED_NAME_FILLED_AVG_PRICE
- See Also:
-
SERIALIZED_NAME_FILLED_QTY
- See Also:
-
SERIALIZED_NAME_HWM
- See Also:
-
SERIALIZED_NAME_ID
- See Also:
-
SERIALIZED_NAME_LEGS
- See Also:
-
SERIALIZED_NAME_LIMIT_PRICE
- See Also:
-
SERIALIZED_NAME_NOTIONAL
- See Also:
-
SERIALIZED_NAME_ORDER_CLASS
- See Also:
-
SERIALIZED_NAME_ORDER_TYPE
- See Also:
-
SERIALIZED_NAME_POSITION_INTENT
- See Also:
-
SERIALIZED_NAME_QTY
- See Also:
-
SERIALIZED_NAME_REPLACED_AT
- See Also:
-
SERIALIZED_NAME_REPLACED_BY
- See Also:
-
SERIALIZED_NAME_REPLACES
- See Also:
-
SERIALIZED_NAME_SIDE
- See Also:
-
SERIALIZED_NAME_STATUS
- See Also:
-
SERIALIZED_NAME_STOP_PRICE
- See Also:
-
SERIALIZED_NAME_SUBMITTED_AT
- See Also:
-
SERIALIZED_NAME_SWAP_FEE_BPS
- See Also:
-
SERIALIZED_NAME_SWAP_RATE
- See Also:
-
SERIALIZED_NAME_SYMBOL
- See Also:
-
SERIALIZED_NAME_TIME_IN_FORCE
- See Also:
-
SERIALIZED_NAME_TRAIL_PERCENT
- See Also:
-
SERIALIZED_NAME_TRAIL_PRICE
- See Also:
-
SERIALIZED_NAME_TYPE
- See Also:
-
SERIALIZED_NAME_UPDATED_AT
- See Also:
-
SERIALIZED_NAME_USD
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
Order
public Order()
-
-
Method Details
-
assetClass
-
getAssetClass
Get assetClass- Returns:
- assetClass
-
setAssetClass
-
assetId
-
getAssetId
The asset ID (For options this represents the option contract ID)- Returns:
- assetId
-
setAssetId
-
cancelRequestedAt
-
getCancelRequestedAt
Time when cancellation or bust was requested (if applicable)- Returns:
- cancelRequestedAt
-
setCancelRequestedAt
-
canceledAt
-
getCanceledAt
Can be null- Returns:
- canceledAt
-
setCanceledAt
-
clientOrderId
-
getClientOrderId
Client unique order ID- Returns:
- clientOrderId
-
setClientOrderId
-
commission
-
getCommission
The dollar value commission for this order.- Returns:
- commission
-
setCommission
-
commissionBps
Deprecated. -
getCommissionBps
Deprecated.**deprecated**: Please use the commission_type = bps instead and set the desired bps value in the `commission` field. The percent commission you want to charge the end user on the order (expressed in bps). Alpaca will convert the order to a notional amount for purposes of calculating commission.- Returns:
- commissionBps
-
setCommissionBps
Deprecated. -
commissionType
-
getCommissionType
Get commissionType- Returns:
- commissionType
-
setCommissionType
-
createdAt
-
getCreatedAt
Time when order was entered- Returns:
- createdAt
-
setCreatedAt
-
expiredAt
-
getExpiredAt
Can be null- Returns:
- expiredAt
-
setExpiredAt
-
extendedHours
-
getExtendedHours
Get extendedHours- Returns:
- extendedHours
-
setExtendedHours
-
failedAt
-
getFailedAt
Can be null- Returns:
- failedAt
-
setFailedAt
-
filledAt
-
getFilledAt
Time the order was filled. Can be null if not filled- Returns:
- filledAt
-
setFilledAt
-
filledAvgPrice
-
getFilledAvgPrice
Filled average price. Can be 0 until order is processed in case order is passed outside of market hours- Returns:
- filledAvgPrice
-
setFilledAvgPrice
-
filledQty
-
getFilledQty
Filled quantity- Returns:
- filledQty
-
setFilledQty
-
hwm
-
getHwm
The highest (lowest) market price seen since the trailing stop order was submitted.- Returns:
- hwm
-
setHwm
-
id
-
getId
Order ID generated by Alpaca- Returns:
- id
-
setId
-
legs
-
addLegsItem
-
getLegs
When querying non-simple order_class orders in a nested style, an array of Order entities associated with this order. Otherwise, null.- Returns:
- legs
-
setLegs
-
limitPrice
-
getLimitPrice
Limit price- Returns:
- limitPrice
-
setLimitPrice
-
notional
-
getNotional
Ordered notional amount. If entered, qty will be null. Can take up to 2 decimal points.- Returns:
- notional
-
setNotional
-
orderClass
-
getOrderClass
Get orderClass- Returns:
- orderClass
-
setOrderClass
-
orderType
-
getOrderType
Get orderType- Returns:
- orderType
-
setOrderType
-
positionIntent
-
getPositionIntent
Get positionIntent- Returns:
- positionIntent
-
setPositionIntent
-
qty
-
getQty
Ordered quantity. If entered, notional will be null. Can take up to 2 decimal points.- Returns:
- qty
-
setQty
-
replacedAt
-
getReplacedAt
Can be null- Returns:
- replacedAt
-
setReplacedAt
-
replacedBy
-
getReplacedBy
The order ID that this order was replaced by. (Can be null)- Returns:
- replacedBy
-
setReplacedBy
-
replaces
-
getReplaces
The order ID that this order replaces. (Can be null)- Returns:
- replaces
-
setReplaces
-
side
-
getSide
Get side- Returns:
- side
-
setSide
-
status
-
getStatus
Get status- Returns:
- status
-
setStatus
-
stopPrice
-
getStopPrice
Stop price- Returns:
- stopPrice
-
setStopPrice
-
submittedAt
-
getSubmittedAt
Time the order was submitted for execution or, if not yet submitted the created_at time. Because orders are submitted for execution asynchronous to database updates, at times this may be before the created_at time.- Returns:
- submittedAt
-
setSubmittedAt
-
swapFeeBps
-
getSwapFeeBps
Fee in basis points on top swap rate charged by the correspondent on every order- Returns:
- swapFeeBps
-
setSwapFeeBps
-
swapRate
-
getSwapRate
Swap rate is the exchange rate (without mark-up) used to convert the price into local currency or crypto asset- Returns:
- swapRate
-
setSwapRate
-
symbol
-
getSymbol
The asset symbol- Returns:
- symbol
-
setSymbol
-
timeInForce
-
getTimeInForce
Get timeInForce- Returns:
- timeInForce
-
setTimeInForce
-
trailPercent
-
getTrailPercent
The percent value away from the high water mark for trailing stop orders.- Returns:
- trailPercent
-
setTrailPercent
-
trailPrice
-
getTrailPrice
The dollar value away from the high water mark for trailing stop orders.- Returns:
- trailPrice
-
setTrailPrice
-
type
-
getType
Get type- Returns:
- type
-
setType
-
updatedAt
-
getUpdatedAt
Time of most recent change to the order- Returns:
- updatedAt
-
setUpdatedAt
-
usd
-
getUsd
Nested object to encompass the USD equivalent fields for the local currency fields- Returns:
- usd
-
setUsd
-
putAdditionalProperty
Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.- Parameters:
key- name of the propertyvalue- value of the property- Returns:
- the Order instance itself
-
getAdditionalProperties
Return the additional (undeclared) property.- Returns:
- a map of objects
-
getAdditionalProperty
Return the additional (undeclared) property with the specified name.- Parameters:
key- name of the property- Returns:
- an object
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is invalid with respect to Order
-
fromJson
Create an instance of Order given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Order
- Throws:
IOException- if the JSON string is invalid with respect to Order
-
toJson
Convert an instance of Order to an JSON string- Returns:
- JSON string
-