Class CreateOrderRequest
java.lang.Object
markets.alpaca.client.openapi.broker.model.CreateOrderRequest
- All Implemented Interfaces:
Serializable
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class CreateOrderRequest
extends Object
implements Serializable
CreateOrderRequest
- 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 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) commission(BigDecimal commission) commissionBps(BigDecimal commissionBps) Deprecated.commissionType(CommissionType commissionType) booleanextendedHours(Boolean extendedHours) static CreateOrderRequestCreate an instance of CreateOrderRequest given an JSON stringReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.Get advancedInstructionsA unique identifier for the order.The commission you want to collect from the user.Deprecated.Get commissionTypeDefaults to false.Get instructionsgetLegs()list of order legs (<= 4)Required if type is `limit` or `stop_limit`.Dollar amount to trade.Get orderClassGet positionIntentgetQty()- For equities, the number of shares to trade.getSide()Get sideGet sourceGet stopLossRequired if type is stop or stop_limitGet subtagGet swapFeeBpsSymbol or asset ID to identify the asset to trade.Get takeProfitGet timeInForceIf type is trailing_stop, then one of trail_price or trail_percent is requiredIf type is trailing_stop, then one of trail_price or trail_percent is requiredgetType()Get typeinthashCode()instructions(String instructions) legs(List<MLegOrderLeg> legs) limitPrice(BigDecimal limitPrice) notional(BigDecimal notional) orderClass(OrderClass orderClass) positionIntent(PositionIntent positionIntent) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.qty(BigDecimal qty) voidsetAdvancedInstructions(AdvancedInstructions advancedInstructions) voidsetClientOrderId(String clientOrderId) voidsetCommission(BigDecimal commission) voidsetCommissionBps(BigDecimal commissionBps) Deprecated.voidsetCommissionType(CommissionType commissionType) voidsetExtendedHours(Boolean extendedHours) voidsetInstructions(String instructions) voidsetLegs(List<MLegOrderLeg> legs) voidsetLimitPrice(BigDecimal limitPrice) voidsetNotional(BigDecimal notional) voidsetOrderClass(OrderClass orderClass) voidsetPositionIntent(PositionIntent positionIntent) voidsetQty(BigDecimal qty) voidvoidvoidsetStopLoss(CreateOrderRequestStopLoss stopLoss) voidsetStopPrice(BigDecimal stopPrice) voidvoidsetSwapFeeBps(BigDecimal swapFeeBps) voidvoidsetTakeProfit(CreateOrderRequestTakeProfit takeProfit) voidsetTimeInForce(TimeInForce timeInForce) voidsetTrailPercent(BigDecimal trailPercent) voidsetTrailPrice(BigDecimal trailPrice) voidstopLoss(CreateOrderRequestStopLoss stopLoss) stopPrice(BigDecimal stopPrice) swapFeeBps(BigDecimal swapFeeBps) takeProfit(CreateOrderRequestTakeProfit takeProfit) timeInForce(TimeInForce timeInForce) toJson()Convert an instance of CreateOrderRequest to an JSON stringtoString()trailPercent(BigDecimal trailPercent) trailPrice(BigDecimal 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_COMMISSION
- See Also:
-
SERIALIZED_NAME_COMMISSION_BPS
- See Also:
-
SERIALIZED_NAME_COMMISSION_TYPE
- See Also:
-
SERIALIZED_NAME_EXTENDED_HOURS
- See Also:
-
SERIALIZED_NAME_INSTRUCTIONS
- 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_SOURCE
- See Also:
-
SERIALIZED_NAME_STOP_LOSS
- See Also:
-
SERIALIZED_NAME_STOP_PRICE
- See Also:
-
SERIALIZED_NAME_SUBTAG
- See Also:
-
SERIALIZED_NAME_SWAP_FEE_BPS
- 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
-
CreateOrderRequest
public CreateOrderRequest()
-
-
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
-
commission
-
getCommission
The commission you want to collect from the user.- Returns:
- commission
-
setCommission
-
commissionBps
Deprecated. -
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. -
commissionType
-
getCommissionType
Get commissionType- Returns:
- commissionType
-
setCommissionType
-
extendedHours
-
getExtendedHours
Defaults to 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
-
instructions
-
getInstructions
Get instructions- Returns:
- instructions
-
setInstructions
-
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. - In case of Fied Income, the price is expressed in percentage of par value (face value). Price is always clean price, meaning it does not include accrued interest.- Returns:
- limitPrice
-
setLimitPrice
-
notional
-
getNotional
Dollar amount to trade. Cannot work with qty. Only market and limit orders supported with time_in_force = day; Only limit orders for extended hours.- Returns:
- notional
-
setNotional
-
orderClass
-
getOrderClass
Get orderClass- Returns:
- orderClass
-
setOrderClass
-
positionIntent
-
getPositionIntent
Get positionIntent- Returns:
- positionIntent
-
setPositionIntent
-
qty
-
getQty
- For equities, the 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. - For Fixed Income securities, qty represents the order size in par value (face value). For example, to place an order for 1 bond with a face value of $1,000, provide a qty of 1000.- Returns:
- qty
-
setQty
-
side
-
getSide
Get side- Returns:
- side
-
setSide
-
source
-
getSource
Get source- Returns:
- source
-
setSource
-
stopLoss
-
getStopLoss
Get stopLoss- Returns:
- stopLoss
-
setStopLoss
-
stopPrice
-
getStopPrice
Required if type is stop or stop_limit- Returns:
- stopPrice
-
setStopPrice
-
subtag
-
getSubtag
Get subtag- Returns:
- subtag
-
setSubtag
-
swapFeeBps
-
getSwapFeeBps
Get swapFeeBps- Returns:
- swapFeeBps
-
setSwapFeeBps
-
symbol
-
getSymbol
Symbol or asset ID 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
If type is trailing_stop, then one of trail_price or trail_percent is required- Returns:
- trailPercent
-
setTrailPercent
-
trailPrice
-
getTrailPrice
If type is trailing_stop, then one of trail_price or trail_percent is required- 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 CreateOrderRequest 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 CreateOrderRequest
-
fromJson
Create an instance of CreateOrderRequest given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of CreateOrderRequest
- Throws:
IOException- if the JSON string is invalid with respect to CreateOrderRequest
-
toJson
Convert an instance of CreateOrderRequest to an JSON string- Returns:
- JSON string
-