Class TradeUpdateEvent
java.lang.Object
net.jacobpeterson.alpaca.openapi.broker.model.TradeUpdateEvent
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2024-03-23T18:58:47.485165-07:00[America/Los_Angeles]")
public class TradeUpdateEvent
extends Object
Represents an update to an order/trade, sent over the events streaming api.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Predicate
<com.google.gson.JsonElement> static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionat
(OffsetDateTime at) boolean
event
(TradeUpdateEventType event) executionId
(UUID executionId) static TradeUpdateEvent
Create an instance of TradeUpdateEvent given an JSON stringAccount UUIDgetAt()
Timestamp of eventgetEvent()
Get eventMonotonically increasing 64bit integerlexically sortable, monotonically increasing character arrayCorresponding execution of an order.getOrder()
Get orderOnly present when event is either `fill` or `partial_fill`.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.int
hashCode()
positionQty
(String positionQty) void
setAccountId
(UUID accountId) void
setAt
(OffsetDateTime at) void
setEvent
(TradeUpdateEventType event) void
setEventId
(Long eventId) void
setEventUlid
(String eventUlid) void
setExecutionId
(UUID executionId) void
void
setPositionQty
(String positionQty) void
void
void
setTimestamp
(OffsetDateTime timestamp) timestamp
(OffsetDateTime timestamp) toJson()
Convert an instance of TradeUpdateEvent to an JSON stringtoString()
static void
validateJsonElement
(com.google.gson.JsonElement jsonElement)
-
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_TIMESTAMP
- See Also:
-
SERIALIZED_NAME_PRICE
- See Also:
-
SERIALIZED_NAME_POSITION_QTY
- See Also:
-
SERIALIZED_NAME_QTY
- See Also:
-
openapiFields
-
openapiRequiredFields
-
validate
public static boolean validate -
isValid
-
-
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 64bit integer- 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
-
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
-
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
-
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
-
qty
-
getQty
Only present when event is either `fill` or `partial_fill`. The amount of shares this Trade order was for- Returns:
- qty
-
setQty
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
- Throws:
IOException
-
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
-