Class Asset
java.lang.Object
markets.alpaca.client.openapi.broker.model.Asset
- All Implemented Interfaces:
Serializable
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class Asset
extends Object
implements Serializable
Assets are sorted by asset class, exchange and symbol. Some assets are not tradable with Alpaca. These assets will be marked with the flag tradable=false
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumGets or Sets attributesstatic enumBorrow status for US equity assets.static classstatic enumactive or inactive -
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 String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttributesItem(Asset.AttributesEnum attributesItem) attributes(List<Asset.AttributesEnum> attributes) borrowStatus(Asset.BorrowStatusEnum borrowStatus) easyToBorrow(Boolean easyToBorrow) Deprecated.booleanfractionable(Boolean fractionable) static AssetCreate an instance of Asset given an JSON stringReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.Unique characteristics of the asset.Borrow status for US equity assets.Deprecated.Get exchangeAsset is fractionable or notgetId()Asset IDDeprecated.Asset is marginable or notThe margin requirement percentage for the asset's long positions (equities only).The margin requirement percentage for the asset's short positions (equities only).Minimum order size.Amount a trade quantity can be incremented by.getName()The official name of the assetAmount the price can be incremented by.Get propertyClassAsset is shortable or notactive or inactiveThe symbol of the assetAsset is tradable on Alpaca or notinthashCode()maintenanceMarginRequirement(BigDecimal maintenanceMarginRequirement) Deprecated.marginable(Boolean marginable) marginRequirementLong(String marginRequirementLong) marginRequirementShort(String marginRequirementShort) minOrderSize(String minOrderSize) minTradeIncrement(String minTradeIncrement) priceIncrement(String priceIncrement) propertyClass(AssetClass propertyClass) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.voidsetAttributes(List<Asset.AttributesEnum> attributes) voidsetBorrowStatus(Asset.BorrowStatusEnum borrowStatus) voidsetEasyToBorrow(Boolean easyToBorrow) Deprecated.voidsetExchange(Exchange exchange) voidsetFractionable(Boolean fractionable) voidvoidsetMaintenanceMarginRequirement(BigDecimal maintenanceMarginRequirement) Deprecated.voidsetMarginable(Boolean marginable) voidsetMarginRequirementLong(String marginRequirementLong) voidsetMarginRequirementShort(String marginRequirementShort) voidsetMinOrderSize(String minOrderSize) voidsetMinTradeIncrement(String minTradeIncrement) voidvoidsetPriceIncrement(String priceIncrement) voidsetPropertyClass(AssetClass propertyClass) voidsetShortable(Boolean shortable) voidsetStatus(Asset.StatusEnum status) voidvoidsetTradable(Boolean tradable) status(Asset.StatusEnum status) toJson()Convert an instance of Asset to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_ATTRIBUTES
- See Also:
-
SERIALIZED_NAME_BORROW_STATUS
- See Also:
-
SERIALIZED_NAME_PROPERTY_CLASS
- See Also:
-
SERIALIZED_NAME_EASY_TO_BORROW
- See Also:
-
SERIALIZED_NAME_EXCHANGE
- See Also:
-
SERIALIZED_NAME_FRACTIONABLE
- See Also:
-
SERIALIZED_NAME_ID
- See Also:
-
SERIALIZED_NAME_MAINTENANCE_MARGIN_REQUIREMENT
- See Also:
-
SERIALIZED_NAME_MARGIN_REQUIREMENT_LONG
- See Also:
-
SERIALIZED_NAME_MARGIN_REQUIREMENT_SHORT
- See Also:
-
SERIALIZED_NAME_MARGINABLE
- See Also:
-
SERIALIZED_NAME_MIN_ORDER_SIZE
- See Also:
-
SERIALIZED_NAME_MIN_TRADE_INCREMENT
- See Also:
-
SERIALIZED_NAME_NAME
- See Also:
-
SERIALIZED_NAME_PRICE_INCREMENT
- See Also:
-
SERIALIZED_NAME_SHORTABLE
- See Also:
-
SERIALIZED_NAME_STATUS
- See Also:
-
SERIALIZED_NAME_SYMBOL
- See Also:
-
SERIALIZED_NAME_TRADABLE
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
Asset
public Asset()
-
-
Method Details
-
attributes
-
addAttributesItem
-
getAttributes
Unique characteristics of the asset. Supported values: - `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default. - `ptp_with_exception`: Users can open positions in these PTPs without general restrictions. - `ipo`: Accepting limit orders only before the stock begins trading on the secondary market. - `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up. - `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET. - `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled). - `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform. - `overnight_halted`: Asset is eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.- Returns:
- attributes
-
setAttributes
-
borrowStatus
-
getBorrowStatus
Borrow status for US equity assets. This field is omitted for non-US-equity assets.- Returns:
- borrowStatus
-
setBorrowStatus
-
propertyClass
-
getPropertyClass
Get propertyClass- Returns:
- propertyClass
-
setPropertyClass
-
easyToBorrow
Deprecated. -
getEasyToBorrow
Deprecated.**deprecated**: Please use borrow_status instead. Asset is easy-to-borrow or not (filtering for easy_to_borrow = True is the best way to check whether the name is currently available to short at Alpaca).- Returns:
- easyToBorrow
-
setEasyToBorrow
Deprecated. -
exchange
-
getExchange
Get exchange- Returns:
- exchange
-
setExchange
-
fractionable
-
getFractionable
Asset is fractionable or not- Returns:
- fractionable
-
setFractionable
-
id
-
getId
Asset ID- Returns:
- id
-
setId
-
maintenanceMarginRequirement
@Deprecated public Asset maintenanceMarginRequirement(@Nonnull BigDecimal maintenanceMarginRequirement) Deprecated. -
getMaintenanceMarginRequirement
Deprecated.**deprecated**: Please use margin_requirement_long or margin_requirement_short instead. Note that these fields are of type string. Shows the margin requirement percentage for the asset (equities only).- Returns:
- maintenanceMarginRequirement
-
setMaintenanceMarginRequirement
@Deprecated public void setMaintenanceMarginRequirement(@Nonnull BigDecimal maintenanceMarginRequirement) Deprecated. -
marginRequirementLong
-
getMarginRequirementLong
The margin requirement percentage for the asset's long positions (equities only).- Returns:
- marginRequirementLong
-
setMarginRequirementLong
-
marginRequirementShort
-
getMarginRequirementShort
The margin requirement percentage for the asset's short positions (equities only).- Returns:
- marginRequirementShort
-
setMarginRequirementShort
-
marginable
-
getMarginable
Asset is marginable or not- Returns:
- marginable
-
setMarginable
-
minOrderSize
-
getMinOrderSize
Minimum order size. Field available for crypto only.- Returns:
- minOrderSize
-
setMinOrderSize
-
minTradeIncrement
-
getMinTradeIncrement
Amount a trade quantity can be incremented by. Field available for crypto only.- Returns:
- minTradeIncrement
-
setMinTradeIncrement
-
name
-
getName
The official name of the asset- Returns:
- name
-
setName
-
priceIncrement
-
getPriceIncrement
Amount the price can be incremented by. Field available for crypto only.- Returns:
- priceIncrement
-
setPriceIncrement
-
shortable
-
getShortable
Asset is shortable or not- Returns:
- shortable
-
setShortable
-
status
-
getStatus
active or inactive- Returns:
- status
-
setStatus
-
symbol
-
getSymbol
The symbol of the asset- Returns:
- symbol
-
setSymbol
-
tradable
-
getTradable
Asset is tradable on Alpaca or not- Returns:
- tradable
-
setTradable
-
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 Asset 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 Asset
-
fromJson
Create an instance of Asset given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Asset
- Throws:
IOException- if the JSON string is invalid with respect to Asset
-
toJson
Convert an instance of Asset to an JSON string- Returns:
- JSON string
-