java.lang.Object
markets.alpaca.client.openapi.broker.model.OrderLeg
All Implemented Interfaces:
Serializable

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class OrderLeg extends Object implements Serializable
OrderLeg
See Also:
  • Field Details

  • Constructor Details

    • OrderLeg

      public OrderLeg()
  • Method Details

    • assetClass

      public OrderLeg assetClass(@Nullable AssetClass assetClass)
    • getAssetClass

      @Nullable public AssetClass getAssetClass()
      Get assetClass
      Returns:
      assetClass
    • setAssetClass

      public void setAssetClass(@Nullable AssetClass assetClass)
    • assetId

      public OrderLeg assetId(@Nullable UUID assetId)
    • getAssetId

      @Nullable public UUID getAssetId()
      The asset ID (For options this represents the option contract ID)
      Returns:
      assetId
    • setAssetId

      public void setAssetId(@Nullable UUID assetId)
    • canceledAt

      public OrderLeg canceledAt(@Nullable OffsetDateTime canceledAt)
    • getCanceledAt

      @Nullable public OffsetDateTime getCanceledAt()
      Can be null
      Returns:
      canceledAt
    • setCanceledAt

      public void setCanceledAt(@Nullable OffsetDateTime canceledAt)
    • clientOrderId

      public OrderLeg clientOrderId(@Nullable String clientOrderId)
    • getClientOrderId

      @Nullable public String getClientOrderId()
      Client unique order ID
      Returns:
      clientOrderId
    • setClientOrderId

      public void setClientOrderId(@Nullable String clientOrderId)
    • commission

      public OrderLeg commission(@Nullable BigDecimal commission)
    • getCommission

      @Nullable public BigDecimal getCommission()
      The dollar value commission you want to charge the end user.
      Returns:
      commission
    • setCommission

      public void setCommission(@Nullable BigDecimal commission)
    • commissionBps

      @Deprecated public OrderLeg commissionBps(@Nullable BigDecimal commissionBps)
      Deprecated.
    • getCommissionBps

      @Deprecated @Nullable public BigDecimal getCommissionBps()
      Deprecated.
      **deprecated**: Please use the commission_type = bps instead and set the desired bps value in the `commission` field. The percent commission you want to charge the end user on the order (expressed in bps). Alpaca will convert the order to a notional amount for purposes of calculating commission.
      Returns:
      commissionBps
    • setCommissionBps

      @Deprecated public void setCommissionBps(@Nullable BigDecimal commissionBps)
      Deprecated.
    • commissionType

      public OrderLeg commissionType(@Nullable CommissionType commissionType)
    • getCommissionType

      @Nullable public CommissionType getCommissionType()
      Get commissionType
      Returns:
      commissionType
    • setCommissionType

      public void setCommissionType(@Nullable CommissionType commissionType)
    • createdAt

      public OrderLeg createdAt(@Nullable OffsetDateTime createdAt)
    • getCreatedAt

      @Nullable public OffsetDateTime getCreatedAt()
      Time when order was entered
      Returns:
      createdAt
    • setCreatedAt

      public void setCreatedAt(@Nullable OffsetDateTime createdAt)
    • expiredAt

      public OrderLeg expiredAt(@Nullable OffsetDateTime expiredAt)
    • getExpiredAt

      @Nullable public OffsetDateTime getExpiredAt()
      Can be null
      Returns:
      expiredAt
    • setExpiredAt

      public void setExpiredAt(@Nullable OffsetDateTime expiredAt)
    • extendedHours

      public OrderLeg extendedHours(@Nullable Boolean extendedHours)
    • getExtendedHours

      @Nullable public Boolean getExtendedHours()
      Get extendedHours
      Returns:
      extendedHours
    • setExtendedHours

      public void setExtendedHours(@Nullable Boolean extendedHours)
    • failedAt

      public OrderLeg failedAt(@Nullable OffsetDateTime failedAt)
    • getFailedAt

      @Nullable public OffsetDateTime getFailedAt()
      Can be null
      Returns:
      failedAt
    • setFailedAt

      public void setFailedAt(@Nullable OffsetDateTime failedAt)
    • filledAt

      public OrderLeg filledAt(@Nullable OffsetDateTime filledAt)
    • getFilledAt

      @Nullable public OffsetDateTime getFilledAt()
      Time the order was filled. Can be null if not filled
      Returns:
      filledAt
    • setFilledAt

      public void setFilledAt(@Nullable OffsetDateTime filledAt)
    • filledAvgPrice

      public OrderLeg filledAvgPrice(@Nullable BigDecimal filledAvgPrice)
    • getFilledAvgPrice

      @Nullable public BigDecimal getFilledAvgPrice()
      Filled average price. Can be 0 until order is processed in case order is passed outside of market hours
      Returns:
      filledAvgPrice
    • setFilledAvgPrice

      public void setFilledAvgPrice(@Nullable BigDecimal filledAvgPrice)
    • filledQty

      public OrderLeg filledQty(@Nullable BigDecimal filledQty)
    • getFilledQty

      @Nullable public BigDecimal getFilledQty()
      Filled quantity
      Returns:
      filledQty
    • setFilledQty

      public void setFilledQty(@Nullable BigDecimal filledQty)
    • hwm

      public OrderLeg hwm(@Nullable BigDecimal hwm)
    • getHwm

      @Nullable public BigDecimal getHwm()
      The highest (lowest) market price seen since the trailing stop order was submitted.
      Returns:
      hwm
    • setHwm

      public void setHwm(@Nullable BigDecimal hwm)
    • id

      public OrderLeg id(@Nonnull UUID id)
    • getId

      @Nonnull public UUID getId()
      Order ID generated by Alpaca
      Returns:
      id
    • setId

      public void setId(@Nonnull UUID id)
    • legs

      public OrderLeg legs(@Nullable List<Object> legs)
    • addLegsItem

      public OrderLeg addLegsItem(Object legsItem)
    • getLegs

      @Nullable public List<Object> getLegs()
      Always null for an order leg; legs are not nested beyond one level.
      Returns:
      legs
    • setLegs

      public void setLegs(@Nullable List<Object> legs)
    • limitPrice

      public OrderLeg limitPrice(@Nullable BigDecimal limitPrice)
    • getLimitPrice

      @Nullable public BigDecimal getLimitPrice()
      Limit price
      Returns:
      limitPrice
    • setLimitPrice

      public void setLimitPrice(@Nullable BigDecimal limitPrice)
    • notional

      public OrderLeg notional(@Nullable BigDecimal notional)
    • getNotional

      @Nullable public BigDecimal getNotional()
      Ordered notional amount. If entered, qty will be null. Can take up to 2 decimal points.
      Returns:
      notional
    • setNotional

      public void setNotional(@Nullable BigDecimal notional)
    • orderClass

      public OrderLeg orderClass(@Nullable OrderClass orderClass)
    • getOrderClass

      @Nullable public OrderClass getOrderClass()
      Get orderClass
      Returns:
      orderClass
    • setOrderClass

      public void setOrderClass(@Nullable OrderClass orderClass)
    • orderType

      public OrderLeg orderType(@Nullable OrderType orderType)
    • getOrderType

      @Nullable public OrderType getOrderType()
      Get orderType
      Returns:
      orderType
    • setOrderType

      public void setOrderType(@Nullable OrderType orderType)
    • positionIntent

      public OrderLeg positionIntent(@Nullable PositionIntent positionIntent)
    • getPositionIntent

      @Nullable public PositionIntent getPositionIntent()
      Get positionIntent
      Returns:
      positionIntent
    • setPositionIntent

      public void setPositionIntent(@Nullable PositionIntent positionIntent)
    • qty

      public OrderLeg qty(@Nullable BigDecimal qty)
    • getQty

      @Nullable public BigDecimal getQty()
      Ordered quantity. If entered, notional will be null. Can take up to 2 decimal points.
      Returns:
      qty
    • setQty

      public void setQty(@Nullable BigDecimal qty)
    • replacedAt

      public OrderLeg replacedAt(@Nullable OffsetDateTime replacedAt)
    • getReplacedAt

      @Nullable public OffsetDateTime getReplacedAt()
      Can be null
      Returns:
      replacedAt
    • setReplacedAt

      public void setReplacedAt(@Nullable OffsetDateTime replacedAt)
    • replacedBy

      public OrderLeg replacedBy(@Nullable UUID replacedBy)
    • getReplacedBy

      @Nullable public UUID getReplacedBy()
      The order ID that this order was replaced by. (Can be null)
      Returns:
      replacedBy
    • setReplacedBy

      public void setReplacedBy(@Nullable UUID replacedBy)
    • replaces

      public OrderLeg replaces(@Nullable UUID replaces)
    • getReplaces

      @Nullable public UUID getReplaces()
      The order ID that this order replaces. (Can be null)
      Returns:
      replaces
    • setReplaces

      public void setReplaces(@Nullable UUID replaces)
    • side

      public OrderLeg side(@Nullable OrderSide side)
    • getSide

      @Nullable public OrderSide getSide()
      Get side
      Returns:
      side
    • setSide

      public void setSide(@Nullable OrderSide side)
    • status

      public OrderLeg status(@Nullable OrderStatus status)
    • getStatus

      @Nullable public OrderStatus getStatus()
      Get status
      Returns:
      status
    • setStatus

      public void setStatus(@Nullable OrderStatus status)
    • stopPrice

      public OrderLeg stopPrice(@Nullable BigDecimal stopPrice)
    • getStopPrice

      @Nullable public BigDecimal getStopPrice()
      Stop price
      Returns:
      stopPrice
    • setStopPrice

      public void setStopPrice(@Nullable BigDecimal stopPrice)
    • submittedAt

      public OrderLeg submittedAt(@Nullable OffsetDateTime submittedAt)
    • getSubmittedAt

      @Nullable public OffsetDateTime getSubmittedAt()
      Time the order was submitted for execution or, if not yet submitted the created_at time. Because orders are submitted for execution asynchronous to database updates, at times this may be before the created_at time.
      Returns:
      submittedAt
    • setSubmittedAt

      public void setSubmittedAt(@Nullable OffsetDateTime submittedAt)
    • swapFeeBps

      public OrderLeg swapFeeBps(@Nullable String swapFeeBps)
    • getSwapFeeBps

      @Nullable public String getSwapFeeBps()
      Fee in basis points on top swap rate charged by the correspondent on every order
      Returns:
      swapFeeBps
    • setSwapFeeBps

      public void setSwapFeeBps(@Nullable String swapFeeBps)
    • swapRate

      public OrderLeg swapRate(@Nullable String swapRate)
    • getSwapRate

      @Nullable public String getSwapRate()
      Swap rate is the exchange rate (without mark-up) used to convert the price into local currency or crypto asset
      Returns:
      swapRate
    • setSwapRate

      public void setSwapRate(@Nullable String swapRate)
    • symbol

      public OrderLeg symbol(@Nonnull String symbol)
    • getSymbol

      @Nonnull public String getSymbol()
      The asset symbol
      Returns:
      symbol
    • setSymbol

      public void setSymbol(@Nonnull String symbol)
    • timeInForce

      public OrderLeg timeInForce(@Nullable TimeInForce timeInForce)
    • getTimeInForce

      @Nullable public TimeInForce getTimeInForce()
      Get timeInForce
      Returns:
      timeInForce
    • setTimeInForce

      public void setTimeInForce(@Nullable TimeInForce timeInForce)
    • trailPercent

      public OrderLeg trailPercent(@Nullable BigDecimal trailPercent)
    • getTrailPercent

      @Nullable public BigDecimal getTrailPercent()
      The percent value away from the high water mark for trailing stop orders.
      Returns:
      trailPercent
    • setTrailPercent

      public void setTrailPercent(@Nullable BigDecimal trailPercent)
    • trailPrice

      public OrderLeg trailPrice(@Nullable BigDecimal trailPrice)
    • getTrailPrice

      @Nullable public BigDecimal getTrailPrice()
      The dollar value away from the high water mark for trailing stop orders.
      Returns:
      trailPrice
    • setTrailPrice

      public void setTrailPrice(@Nullable BigDecimal trailPrice)
    • type

      public OrderLeg type(@Nullable OrderType type)
    • getType

      @Nullable public OrderType getType()
      Get type
      Returns:
      type
    • setType

      public void setType(@Nullable OrderType type)
    • updatedAt

      public OrderLeg updatedAt(@Nullable OffsetDateTime updatedAt)
    • getUpdatedAt

      @Nullable public OffsetDateTime getUpdatedAt()
      Time of most recent change to the order
      Returns:
      updatedAt
    • setUpdatedAt

      public void setUpdatedAt(@Nullable OffsetDateTime updatedAt)
    • usd

      public OrderLeg usd(@Nullable Object usd)
    • getUsd

      @Nullable public Object getUsd()
      Nested object to encompass the USD equivalent fields for the local currency fields
      Returns:
      usd
    • setUsd

      public void setUsd(@Nullable Object usd)
    • putAdditionalProperty

      public OrderLeg putAdditionalProperty(String key, Object value)
      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 property
      value - value of the property
      Returns:
      the OrderLeg instance itself
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Return the additional (undeclared) property.
      Returns:
      a map of objects
    • getAdditionalProperty

      public Object getAdditionalProperty(String key)
      Return the additional (undeclared) property with the specified name.
      Parameters:
      key - name of the property
      Returns:
      an object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      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 OrderLeg
    • fromJson

      public static OrderLeg fromJson(String jsonString) throws IOException
      Create an instance of OrderLeg given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of OrderLeg
      Throws:
      IOException - if the JSON string is invalid with respect to OrderLeg
    • toJson

      public String toJson()
      Convert an instance of OrderLeg to an JSON string
      Returns:
      JSON string