Class PostOrderRequest

java.lang.Object
markets.alpaca.client.openapi.trading.model.PostOrderRequest
All Implemented Interfaces:
Serializable

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

  • Constructor Details

    • PostOrderRequest

      public PostOrderRequest()
  • Method Details

    • advancedInstructions

      public PostOrderRequest advancedInstructions(@Nullable AdvancedInstructions advancedInstructions)
    • getAdvancedInstructions

      @Nullable public AdvancedInstructions getAdvancedInstructions()
      Get advancedInstructions
      Returns:
      advancedInstructions
    • setAdvancedInstructions

      public void setAdvancedInstructions(@Nullable AdvancedInstructions advancedInstructions)
    • clientOrderId

      public PostOrderRequest clientOrderId(@Nullable String clientOrderId)
    • getClientOrderId

      @Nullable public String getClientOrderId()
      A unique identifier for the order. Automatically generated if not sent. (<= 128 characters)
      Returns:
      clientOrderId
    • setClientOrderId

      public void setClientOrderId(@Nullable String clientOrderId)
    • extendedHours

      public PostOrderRequest extendedHours(@Nullable Boolean extendedHours)
    • getExtendedHours

      @Nullable public Boolean getExtendedHours()
      (default) false. If true, order will be eligible for execution in the pre-market, after-hours, and overnight sessions. Only works with type `limit` and time_in_force set to either `day` or `gtc`
      Returns:
      extendedHours
    • setExtendedHours

      public void setExtendedHours(@Nullable Boolean extendedHours)
    • legs

      public PostOrderRequest legs(@Nullable List<MLegOrderLeg> legs)
    • addLegsItem

      public PostOrderRequest addLegsItem(MLegOrderLeg legsItem)
    • getLegs

      @Nullable public List<MLegOrderLeg> getLegs()
      list of order legs (<= 4)
      Returns:
      legs
    • setLegs

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

      public PostOrderRequest limitPrice(@Nullable String limitPrice)
    • getLimitPrice

      @Nullable public String getLimitPrice()
      Required if type is `limit` or `stop_limit`. In case of `mleg`, the limit_price parameter is expressed with the following notation: - A positive value indicates a debit, representing a cost or payment to be made. - A negative value signifies a credit, reflecting an amount to be received.
      Returns:
      limitPrice
    • setLimitPrice

      public void setLimitPrice(@Nullable String limitPrice)
    • notional

      public PostOrderRequest notional(@Nullable String notional)
    • getNotional

      @Nullable public String getNotional()
      dollar amount to trade. Cannot work with `qty`. Can only work for market order types and day for time in force.
      Returns:
      notional
    • setNotional

      public void setNotional(@Nullable String notional)
    • orderClass

      public PostOrderRequest orderClass(@Nullable OrderClass orderClass)
    • getOrderClass

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

      public void setOrderClass(@Nullable OrderClass orderClass)
    • positionIntent

      public PostOrderRequest positionIntent(@Nullable PositionIntent positionIntent)
    • getPositionIntent

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

      public void setPositionIntent(@Nullable PositionIntent positionIntent)
    • qty

      public PostOrderRequest qty(@Nullable String qty)
    • getQty

      @Nullable public String getQty()
      number of shares to trade. Can be fractionable for only market and day order types. Required for `mleg` order class, represents the number of units to trade of this strategy.
      Returns:
      qty
    • setQty

      public void setQty(@Nullable String qty)
    • side

      public PostOrderRequest side(@Nullable OrderSide side)
    • getSide

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

      public void setSide(@Nullable OrderSide side)
    • stopLoss

      public PostOrderRequest stopLoss(@Nullable PostOrderRequestStopLoss stopLoss)
    • getStopLoss

      @Nullable public PostOrderRequestStopLoss getStopLoss()
      Get stopLoss
      Returns:
      stopLoss
    • setStopLoss

      public void setStopLoss(@Nullable PostOrderRequestStopLoss stopLoss)
    • stopPrice

      public PostOrderRequest stopPrice(@Nullable String stopPrice)
    • getStopPrice

      @Nullable public String getStopPrice()
      required if type is `stop` or `stop_limit`
      Returns:
      stopPrice
    • setStopPrice

      public void setStopPrice(@Nullable String stopPrice)
    • symbol

      public PostOrderRequest symbol(@Nullable String symbol)
    • getSymbol

      @Nullable public String getSymbol()
      symbol, asset ID, or currency pair to identify the asset to trade, required for all order classes except for `mleg`.
      Returns:
      symbol
    • setSymbol

      public void setSymbol(@Nullable String symbol)
    • takeProfit

      public PostOrderRequest takeProfit(@Nullable PostOrderRequestTakeProfit takeProfit)
    • getTakeProfit

      @Nullable public PostOrderRequestTakeProfit getTakeProfit()
      Get takeProfit
      Returns:
      takeProfit
    • setTakeProfit

      public void setTakeProfit(@Nullable PostOrderRequestTakeProfit takeProfit)
    • timeInForce

      public PostOrderRequest timeInForce(@Nonnull TimeInForce timeInForce)
    • getTimeInForce

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

      public void setTimeInForce(@Nonnull TimeInForce timeInForce)
    • trailPercent

      public PostOrderRequest trailPercent(@Nullable String trailPercent)
    • getTrailPercent

      @Nullable public String getTrailPercent()
      this or `trail_price` is required if type is `trailing_stop`
      Returns:
      trailPercent
    • setTrailPercent

      public void setTrailPercent(@Nullable String trailPercent)
    • trailPrice

      public PostOrderRequest trailPrice(@Nullable String trailPrice)
    • getTrailPrice

      @Nullable public String getTrailPrice()
      this or `trail_percent` is required if type is `trailing_stop`
      Returns:
      trailPrice
    • setTrailPrice

      public void setTrailPrice(@Nullable String trailPrice)
    • type

      public PostOrderRequest type(@Nonnull OrderType type)
    • getType

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

      public void setType(@Nonnull OrderType type)
    • putAdditionalProperty

      public PostOrderRequest 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 PostOrderRequest 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 PostOrderRequest
    • fromJson

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

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