Package markets.alpaca.client.ws.model
Record Class TradeUpdate
java.lang.Object
java.lang.Record
markets.alpaca.client.ws.model.TradeUpdate
- Record Components:
event- order lifecycle event typeexecutionId- unique execution ID (present on fill events)price- average fill price (fill and partial_fill events)qty- filled quantity for this event (fill and partial_fill events)positionQty- total position size after this event in shares (fill and partial_fill)timestamp- event timestamp (fill, partial_fill, canceled, expired, replaced, rejected)order- the full order entity
public record TradeUpdate(String event, String executionId, String price, String qty, String positionQty, String timestamp, Order order)
extends Record
An order lifecycle event for the authenticated account.
Emitted for every state change on an order. All events include an event type and the
full order object. Fill events also carry price, qty, and positionQty. Cancellation, expiry, and replacement events include a timestamp.
Common event types: new, fill, partial_fill, canceled,
expired, replaced, rejected, pending_new, etc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.event()Returns the value of theeventrecord component.Returns the value of theexecutionIdrecord component.final inthashCode()Returns a hash code value for this object.order()Returns the value of theorderrecord component.Returns the value of thepositionQtyrecord component.price()Returns the value of thepricerecord component.qty()Returns the value of theqtyrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TradeUpdate
public TradeUpdate(String event, String executionId, String price, String qty, String positionQty, String timestamp, Order order) Creates an instance of aTradeUpdaterecord class.- Parameters:
event- the value for theeventrecord componentexecutionId- the value for theexecutionIdrecord componentprice- the value for thepricerecord componentqty- the value for theqtyrecord componentpositionQty- the value for thepositionQtyrecord componenttimestamp- the value for thetimestamprecord componentorder- the value for theorderrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
event
Returns the value of theeventrecord component.- Returns:
- the value of the
eventrecord component
-
executionId
Returns the value of theexecutionIdrecord component.- Returns:
- the value of the
executionIdrecord component
-
price
Returns the value of thepricerecord component.- Returns:
- the value of the
pricerecord component
-
qty
Returns the value of theqtyrecord component.- Returns:
- the value of the
qtyrecord component
-
positionQty
Returns the value of thepositionQtyrecord component.- Returns:
- the value of the
positionQtyrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
order
Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-