Class TradeUpdateEventV2
java.lang.Object
markets.alpaca.client.openapi.broker.model.TradeUpdateEventV2
- All Implemented Interfaces:
Serializable
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class TradeUpdateEventV2
extends Object
implements Serializable
Represents an update to an order/trade, sent over the events streaming api.
- 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 String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLegsItem(TradeUpdateEventV2Leg legsItem) at(OffsetDateTime at) booleanevent(TradeUpdateEventType event) executionId(String executionId) static TradeUpdateEventV2Create an instance of TradeUpdateEventV2 given an JSON stringAccount UUIDReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.getAt()Timestamp of eventgetEvent()Get eventlexically sortable, monotonically increasing character arrayCorresponding execution of an order.getLegs()Only present when event is for `MultilegOptions`.getOrder()Get orderOnly present when event is either `fill` or `partial_fill` other than `MultilegOptions`.Only present when event is either `fill` or `partial_fill` for `MultilegOptions`.ID of the original execution that was busted or corrected (present only in trade_bust and trade_correct events).getPrice()Only present when event is either `fill` or `partial_fill`.getQty()Only present when event is either `fill`, `partial_fill`, `trade_bust` and `trade_correct`.Settlement date of the trade in format `YYYY-MM-DD` for `fill` and `partial_fill` eventsOnly present for `local currency trading account` or `crypto asset trade` when event is either `fill` or `partial_fill`.Has various different meanings depending on the value of `event`, please see the [Trading Events](https://alpaca.markets/docs/api-references/broker-api/events/#trade-events) Enum in the documentation or the TradeUpdateEventType model for more details on when it means different things.inthashCode()legs(List<TradeUpdateEventV2Leg> legs) positionQty(String positionQty) positionQtys(String positionQtys) previousExecutionId(UUID previousExecutionId) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.voidsetAccountId(UUID accountId) voidsetAt(OffsetDateTime at) voidsetEvent(TradeUpdateEventType event) voidsetEventId(String eventId) voidsetExecutionId(String executionId) voidsetLegs(List<TradeUpdateEventV2Leg> legs) voidvoidsetPositionQty(String positionQty) voidsetPositionQtys(String positionQtys) voidsetPreviousExecutionId(UUID previousExecutionId) voidvoidvoidsetSettleDate(LocalDate settleDate) voidsetSwapRate(String swapRate) voidsetTimestamp(OffsetDateTime timestamp) settleDate(LocalDate settleDate) timestamp(OffsetDateTime timestamp) toJson()Convert an instance of TradeUpdateEventV2 to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_ACCOUNT_ID
- See Also:
-
SERIALIZED_NAME_AT
- See Also:
-
SERIALIZED_NAME_EVENT
- See Also:
-
SERIALIZED_NAME_EVENT_ID
- See Also:
-
SERIALIZED_NAME_EXECUTION_ID
- See Also:
-
SERIALIZED_NAME_LEGS
- See Also:
-
SERIALIZED_NAME_ORDER
- See Also:
-
SERIALIZED_NAME_POSITION_QTY
- See Also:
-
SERIALIZED_NAME_POSITION_QTYS
- See Also:
-
SERIALIZED_NAME_PREVIOUS_EXECUTION_ID
- See Also:
-
SERIALIZED_NAME_PRICE
- See Also:
-
SERIALIZED_NAME_QTY
- See Also:
-
SERIALIZED_NAME_SETTLE_DATE
- See Also:
-
SERIALIZED_NAME_SWAP_RATE
- See Also:
-
SERIALIZED_NAME_TIMESTAMP
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
TradeUpdateEventV2
public TradeUpdateEventV2()
-
-
Method Details
-
accountId
-
getAccountId
Account UUID- Returns:
- accountId
-
setAccountId
-
at
-
getAt
Timestamp of event- Returns:
- at
-
setAt
-
event
-
getEvent
Get event- Returns:
- event
-
setEvent
-
eventId
-
getEventId
lexically sortable, monotonically increasing character array- Returns:
- eventId
-
setEventId
-
executionId
-
getExecutionId
Corresponding execution of an order. If an order gets filled over two executions (a partial_fill for example), you will receive two events with different IDs. Not present for `MultilegOptions`- Returns:
- executionId
-
setExecutionId
-
legs
-
addLegsItem
-
getLegs
Only present when event is for `MultilegOptions`. Represents filled qty/price of legs.- Returns:
- legs
-
setLegs
-
order
-
getOrder
Get order- Returns:
- order
-
setOrder
-
positionQty
-
getPositionQty
Only present when event is either `fill` or `partial_fill` other than `MultilegOptions`. The size of your total position, after this fill event, in shares. Positive for long positions, negative for short positions.- Returns:
- positionQty
-
setPositionQty
-
positionQtys
-
getPositionQtys
Only present when event is either `fill` or `partial_fill` for `MultilegOptions`. The size of your total position, after this fill event, in shares. Positive for long positions, negative for short positions.- Returns:
- positionQtys
-
setPositionQtys
-
previousExecutionId
-
getPreviousExecutionId
ID of the original execution that was busted or corrected (present only in trade_bust and trade_correct events).- Returns:
- previousExecutionId
-
setPreviousExecutionId
-
price
-
getPrice
Only present when event is either `fill` or `partial_fill`. The average price per share at which the order was filled.- Returns:
- price
-
setPrice
-
qty
-
getQty
Only present when event is either `fill`, `partial_fill`, `trade_bust` and `trade_correct`. The amount of shares this Trade order was for. <br /> For `trade_bust` events, the qty field may be negative, representing a reversal of the original quantity.- Returns:
- qty
-
setQty
-
settleDate
-
getSettleDate
Settlement date of the trade in format `YYYY-MM-DD` for `fill` and `partial_fill` events- Returns:
- settleDate
-
setSettleDate
-
swapRate
-
getSwapRate
Only present for `local currency trading account` or `crypto asset trade` when event is either `fill` or `partial_fill`. The swap rate at which the current trade was filled.- Returns:
- swapRate
-
setSwapRate
-
timestamp
-
getTimestamp
Has various different meanings depending on the value of `event`, please see the [Trading Events](https://alpaca.markets/docs/api-references/broker-api/events/#trade-events) Enum in the documentation or the TradeUpdateEventType model for more details on when it means different things.- Returns:
- timestamp
-
setTimestamp
-
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 TradeUpdateEventV2 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 TradeUpdateEventV2
-
fromJson
Create an instance of TradeUpdateEventV2 given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of TradeUpdateEventV2
- Throws:
IOException- if the JSON string is invalid with respect to TradeUpdateEventV2
-
toJson
Convert an instance of TradeUpdateEventV2 to an JSON string- Returns:
- JSON string
-