Record Class Order

java.lang.Object
java.lang.Record
markets.alpaca.client.ws.model.Order

public record Order(String id, String clientOrderId, String assetId, String assetClass, String symbol, String side, String type, String orderType, String orderClass, String qty, String notional, String filledQty, String filledAvgPrice, String status, String timeInForce, String limitPrice, String stopPrice, String trailPrice, String trailPercent, String hwm, boolean extendedHours, List<Order> legs, String replaces, String replacedBy, String createdAt, String submittedAt, String filledAt, String canceledAt, String expiredAt, String replacedAt, String failedAt, String cancelRequestedAt, String updatedAt) extends Record
An order entity as returned within trade update events.

All monetary values are represented as strings by the Alpaca API to avoid floating-point precision issues. Parse them with BigDecimal.

  • Constructor Details

    • Order

      public Order(String id, String clientOrderId, String assetId, String assetClass, String symbol, String side, String type, String orderType, String orderClass, String qty, String notional, String filledQty, String filledAvgPrice, String status, String timeInForce, String limitPrice, String stopPrice, String trailPrice, String trailPercent, String hwm, boolean extendedHours, List<Order> legs, String replaces, String replacedBy, String createdAt, String submittedAt, String filledAt, String canceledAt, String expiredAt, String replacedAt, String failedAt, String cancelRequestedAt, String updatedAt)
      Creates an instance of a Order record class.
      Parameters:
      id - the value for the id record component
      clientOrderId - the value for the clientOrderId record component
      assetId - the value for the assetId record component
      assetClass - the value for the assetClass record component
      symbol - the value for the symbol record component
      side - the value for the side record component
      type - the value for the type record component
      orderType - the value for the orderType record component
      orderClass - the value for the orderClass record component
      qty - the value for the qty record component
      notional - the value for the notional record component
      filledQty - the value for the filledQty record component
      filledAvgPrice - the value for the filledAvgPrice record component
      status - the value for the status record component
      timeInForce - the value for the timeInForce record component
      limitPrice - the value for the limitPrice record component
      stopPrice - the value for the stopPrice record component
      trailPrice - the value for the trailPrice record component
      trailPercent - the value for the trailPercent record component
      hwm - the value for the hwm record component
      extendedHours - the value for the extendedHours record component
      legs - the value for the legs record component
      replaces - the value for the replaces record component
      replacedBy - the value for the replacedBy record component
      createdAt - the value for the createdAt record component
      submittedAt - the value for the submittedAt record component
      filledAt - the value for the filledAt record component
      canceledAt - the value for the canceledAt record component
      expiredAt - the value for the expiredAt record component
      replacedAt - the value for the replacedAt record component
      failedAt - the value for the failedAt record component
      cancelRequestedAt - the value for the cancelRequestedAt record component
      updatedAt - the value for the updatedAt record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      @SerializedName("id") public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • clientOrderId

      @SerializedName("client_order_id") public String clientOrderId()
      Returns the value of the clientOrderId record component.
      Returns:
      the value of the clientOrderId record component
    • assetId

      @SerializedName("asset_id") public String assetId()
      Returns the value of the assetId record component.
      Returns:
      the value of the assetId record component
    • assetClass

      @SerializedName("asset_class") public String assetClass()
      Returns the value of the assetClass record component.
      Returns:
      the value of the assetClass record component
    • symbol

      @SerializedName("symbol") public String symbol()
      Returns the value of the symbol record component.
      Returns:
      the value of the symbol record component
    • side

      @SerializedName("side") public String side()
      Returns the value of the side record component.
      Returns:
      the value of the side record component
    • type

      @SerializedName("type") public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • orderType

      @SerializedName("order_type") public String orderType()
      Returns the value of the orderType record component.
      Returns:
      the value of the orderType record component
    • orderClass

      @SerializedName("order_class") public String orderClass()
      Returns the value of the orderClass record component.
      Returns:
      the value of the orderClass record component
    • qty

      @SerializedName("qty") public String qty()
      Returns the value of the qty record component.
      Returns:
      the value of the qty record component
    • notional

      @SerializedName("notional") public String notional()
      Returns the value of the notional record component.
      Returns:
      the value of the notional record component
    • filledQty

      @SerializedName("filled_qty") public String filledQty()
      Returns the value of the filledQty record component.
      Returns:
      the value of the filledQty record component
    • filledAvgPrice

      @SerializedName("filled_avg_price") public String filledAvgPrice()
      Returns the value of the filledAvgPrice record component.
      Returns:
      the value of the filledAvgPrice record component
    • status

      @SerializedName("status") public String status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • timeInForce

      @SerializedName("time_in_force") public String timeInForce()
      Returns the value of the timeInForce record component.
      Returns:
      the value of the timeInForce record component
    • limitPrice

      @SerializedName("limit_price") public String limitPrice()
      Returns the value of the limitPrice record component.
      Returns:
      the value of the limitPrice record component
    • stopPrice

      @SerializedName("stop_price") public String stopPrice()
      Returns the value of the stopPrice record component.
      Returns:
      the value of the stopPrice record component
    • trailPrice

      @SerializedName("trail_price") public String trailPrice()
      Returns the value of the trailPrice record component.
      Returns:
      the value of the trailPrice record component
    • trailPercent

      @SerializedName("trail_percent") public String trailPercent()
      Returns the value of the trailPercent record component.
      Returns:
      the value of the trailPercent record component
    • hwm

      @SerializedName("hwm") public String hwm()
      Returns the value of the hwm record component.
      Returns:
      the value of the hwm record component
    • extendedHours

      @SerializedName("extended_hours") public boolean extendedHours()
      Returns the value of the extendedHours record component.
      Returns:
      the value of the extendedHours record component
    • legs

      @SerializedName("legs") public List<Order> legs()
      Returns the value of the legs record component.
      Returns:
      the value of the legs record component
    • replaces

      @SerializedName("replaces") public String replaces()
      Returns the value of the replaces record component.
      Returns:
      the value of the replaces record component
    • replacedBy

      @SerializedName("replaced_by") public String replacedBy()
      Returns the value of the replacedBy record component.
      Returns:
      the value of the replacedBy record component
    • createdAt

      @SerializedName("created_at") public String createdAt()
      Returns the value of the createdAt record component.
      Returns:
      the value of the createdAt record component
    • submittedAt

      @SerializedName("submitted_at") public String submittedAt()
      Returns the value of the submittedAt record component.
      Returns:
      the value of the submittedAt record component
    • filledAt

      @SerializedName("filled_at") public String filledAt()
      Returns the value of the filledAt record component.
      Returns:
      the value of the filledAt record component
    • canceledAt

      @SerializedName("canceled_at") public String canceledAt()
      Returns the value of the canceledAt record component.
      Returns:
      the value of the canceledAt record component
    • expiredAt

      @SerializedName("expired_at") public String expiredAt()
      Returns the value of the expiredAt record component.
      Returns:
      the value of the expiredAt record component
    • replacedAt

      @SerializedName("replaced_at") public String replacedAt()
      Returns the value of the replacedAt record component.
      Returns:
      the value of the replacedAt record component
    • failedAt

      @SerializedName("failed_at") public String failedAt()
      Returns the value of the failedAt record component.
      Returns:
      the value of the failedAt record component
    • cancelRequestedAt

      @SerializedName("cancel_requested_at") public String cancelRequestedAt()
      Returns the value of the cancelRequestedAt record component.
      Returns:
      the value of the cancelRequestedAt record component
    • updatedAt

      @SerializedName("updated_at") public String updatedAt()
      Returns the value of the updatedAt record component.
      Returns:
      the value of the updatedAt record component