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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLegsItem(MLegOrderLeg legsItem) advancedInstructions(AdvancedInstructions advancedInstructions) clientOrderId(String clientOrderId) booleanextendedHours(Boolean extendedHours) static PostOrderRequestCreate an instance of PostOrderRequest given an JSON stringReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.Get advancedInstructionsA unique identifier for the order.(default) false.getLegs()list of order legs (<= 4)Required if type is `limit` or `stop_limit`.dollar amount to trade.Get orderClassGet positionIntentgetQty()number of shares to trade.getSide()Get sideGet stopLossrequired if type is `stop` or `stop_limit`symbol, asset ID, or currency pair to identify the asset to trade, required for all order classes except for `mleg`.Get takeProfitGet timeInForcethis or `trail_price` is required if type is `trailing_stop`this or `trail_percent` is required if type is `trailing_stop`getType()Get typeinthashCode()legs(List<MLegOrderLeg> legs) limitPrice(String limitPrice) orderClass(OrderClass orderClass) positionIntent(PositionIntent positionIntent) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.voidsetAdvancedInstructions(AdvancedInstructions advancedInstructions) voidsetClientOrderId(String clientOrderId) voidsetExtendedHours(Boolean extendedHours) voidsetLegs(List<MLegOrderLeg> legs) voidsetLimitPrice(String limitPrice) voidsetNotional(String notional) voidsetOrderClass(OrderClass orderClass) voidsetPositionIntent(PositionIntent positionIntent) voidvoidvoidsetStopLoss(PostOrderRequestStopLoss stopLoss) voidsetStopPrice(String stopPrice) voidvoidsetTakeProfit(PostOrderRequestTakeProfit takeProfit) voidsetTimeInForce(TimeInForce timeInForce) voidsetTrailPercent(String trailPercent) voidsetTrailPrice(String trailPrice) voidstopLoss(PostOrderRequestStopLoss stopLoss) takeProfit(PostOrderRequestTakeProfit takeProfit) timeInForce(TimeInForce timeInForce) toJson()Convert an instance of PostOrderRequest to an JSON stringtoString()trailPercent(String trailPercent) trailPrice(String trailPrice) static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_ADVANCED_INSTRUCTIONS
- See Also:
-
SERIALIZED_NAME_CLIENT_ORDER_ID
- See Also:
-
SERIALIZED_NAME_EXTENDED_HOURS
- See Also:
-
SERIALIZED_NAME_LEGS
- See Also:
-
SERIALIZED_NAME_LIMIT_PRICE
- See Also:
-
SERIALIZED_NAME_NOTIONAL
- See Also:
-
SERIALIZED_NAME_ORDER_CLASS
- See Also:
-
SERIALIZED_NAME_POSITION_INTENT
- See Also:
-
SERIALIZED_NAME_QTY
- See Also:
-
SERIALIZED_NAME_SIDE
- See Also:
-
SERIALIZED_NAME_STOP_LOSS
- See Also:
-
SERIALIZED_NAME_STOP_PRICE
- See Also:
-
SERIALIZED_NAME_SYMBOL
- See Also:
-
SERIALIZED_NAME_TAKE_PROFIT
- See Also:
-
SERIALIZED_NAME_TIME_IN_FORCE
- See Also:
-
SERIALIZED_NAME_TRAIL_PERCENT
- See Also:
-
SERIALIZED_NAME_TRAIL_PRICE
- See Also:
-
SERIALIZED_NAME_TYPE
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
PostOrderRequest
public PostOrderRequest()
-
-
Method Details
-
advancedInstructions
-
getAdvancedInstructions
Get advancedInstructions- Returns:
- advancedInstructions
-
setAdvancedInstructions
-
clientOrderId
-
getClientOrderId
A unique identifier for the order. Automatically generated if not sent. (<= 128 characters)- Returns:
- clientOrderId
-
setClientOrderId
-
extendedHours
-
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
-
legs
-
addLegsItem
-
getLegs
list of order legs (<= 4)- Returns:
- legs
-
setLegs
-
limitPrice
-
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
-
notional
-
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
-
orderClass
-
getOrderClass
Get orderClass- Returns:
- orderClass
-
setOrderClass
-
positionIntent
-
getPositionIntent
Get positionIntent- Returns:
- positionIntent
-
setPositionIntent
-
qty
-
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
-
side
-
getSide
Get side- Returns:
- side
-
setSide
-
stopLoss
-
getStopLoss
Get stopLoss- Returns:
- stopLoss
-
setStopLoss
-
stopPrice
-
getStopPrice
required if type is `stop` or `stop_limit`- Returns:
- stopPrice
-
setStopPrice
-
symbol
-
getSymbol
symbol, asset ID, or currency pair to identify the asset to trade, required for all order classes except for `mleg`.- Returns:
- symbol
-
setSymbol
-
takeProfit
-
getTakeProfit
Get takeProfit- Returns:
- takeProfit
-
setTakeProfit
-
timeInForce
-
getTimeInForce
Get timeInForce- Returns:
- timeInForce
-
setTimeInForce
-
trailPercent
-
getTrailPercent
this or `trail_price` is required if type is `trailing_stop`- Returns:
- trailPercent
-
setTrailPercent
-
trailPrice
-
getTrailPrice
this or `trail_percent` is required if type is `trailing_stop`- Returns:
- trailPrice
-
setTrailPrice
-
type
-
getType
Get type- Returns:
- type
-
setType
-
putAdditionalProperty
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 propertyvalue- value of the property- Returns:
- the PostOrderRequest instance itself
-
getAdditionalProperties
Return the additional (undeclared) property.- Returns:
- a map of objects
-
getAdditionalProperty
Return the additional (undeclared) property with the specified name.- Parameters:
key- name of the property- Returns:
- an object
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
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
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
Convert an instance of PostOrderRequest to an JSON string- Returns:
- JSON string
-