Class TradeUpdateEvent
java.lang.Object
markets.alpaca.client.openapi.broker.model.TradeUpdateEvent
- All Implemented Interfaces:
Serializable
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class TradeUpdateEvent
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionat(OffsetDateTime at) booleanevent(TradeUpdateEventType event) executionId(UUID executionId) static TradeUpdateEventCreate an instance of TradeUpdateEvent given an JSON stringAccount UUIDReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.getAt()Timestamp of eventgetEvent()Get eventMonotonically increasing 64-bit integer not available to new partners, and for backward compatibility purposes only; use `event_ulid` as the stable identifier where possiblelexically sortable, monotonically increasing character arrayCorresponding execution of an order.getOrder()Get orderOnly present when event is either `fill` or `partial_fill`.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` 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()positionQty(String positionQty) 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(Long eventId) voidsetEventUlid(String eventUlid) voidsetExecutionId(UUID executionId) voidvoidsetPositionQty(String positionQty) voidsetPreviousExecutionId(UUID previousExecutionId) voidvoidvoidsetTimestamp(OffsetDateTime timestamp) timestamp(OffsetDateTime timestamp) toJson()Convert an instance of TradeUpdateEvent 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_EVENT_ULID
- See Also:
-
SERIALIZED_NAME_EXECUTION_ID
- See Also:
-
SERIALIZED_NAME_ORDER
- See Also:
-
SERIALIZED_NAME_POSITION_QTY
- See Also:
-
SERIALIZED_NAME_PREVIOUS_EXECUTION_ID
- See Also:
-
SERIALIZED_NAME_PRICE
- See Also:
-
SERIALIZED_NAME_QTY
- See Also:
-
SERIALIZED_NAME_TIMESTAMP
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
TradeUpdateEvent
public TradeUpdateEvent()
-
-
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
Monotonically increasing 64-bit integer not available to new partners, and for backward compatibility purposes only; use `event_ulid` as the stable identifier where possible- Returns:
- eventId
-
setEventId
-
eventUlid
-
getEventUlid
lexically sortable, monotonically increasing character array- Returns:
- eventUlid
-
setEventUlid
-
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.- Returns:
- executionId
-
setExecutionId
-
order
-
getOrder
Get order- Returns:
- order
-
setOrder
-
positionQty
-
getPositionQty
Only present when event is either `fill` or `partial_fill`. The size of your total position, after this fill event, in shares. Positive for long positions, negative for short positions.- Returns:
- positionQty
-
setPositionQty
-
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` or `partial_fill`. The amount of shares this Trade order was for- Returns:
- qty
-
setQty
-
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 TradeUpdateEvent 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 TradeUpdateEvent
-
fromJson
Create an instance of TradeUpdateEvent given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of TradeUpdateEvent
- Throws:
IOException- if the JSON string is invalid with respect to TradeUpdateEvent
-
toJson
Convert an instance of TradeUpdateEvent to an JSON string- Returns:
- JSON string
-