Class TradeAccount

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

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class TradeAccount extends Object implements Serializable
This is an extended version of the Account model found [in the trading api](https://alpaca.markets/docs/api-references/trading-api/account/#account-entity). Extra data has been added that would be useful for brokers.
See Also:
  • Field Details

  • Constructor Details

    • TradeAccount

      public TradeAccount()
  • Method Details

    • accountBlocked

      public TradeAccount accountBlocked(@Nonnull Boolean accountBlocked)
    • getAccountBlocked

      @Nonnull public Boolean getAccountBlocked()
      If true, the account activity by user is prohibited.
      Returns:
      accountBlocked
    • setAccountBlocked

      public void setAccountBlocked(@Nonnull Boolean accountBlocked)
    • accountNumber

      public TradeAccount accountNumber(@Nullable String accountNumber)
    • getAccountNumber

      @Nullable public String getAccountNumber()
      The account number
      Returns:
      accountNumber
    • setAccountNumber

      public void setAccountNumber(@Nullable String accountNumber)
    • accruedFees

      public TradeAccount accruedFees(@Nonnull BigDecimal accruedFees)
    • getAccruedFees

      @Nonnull public BigDecimal getAccruedFees()
      Accrued fees
      Returns:
      accruedFees
    • setAccruedFees

      public void setAccruedFees(@Nonnull BigDecimal accruedFees)
    • adminConfigurations

      public TradeAccount adminConfigurations(@Nonnull AdminConfigurations adminConfigurations)
    • getAdminConfigurations

      @Nonnull public AdminConfigurations getAdminConfigurations()
      Get adminConfigurations
      Returns:
      adminConfigurations
    • setAdminConfigurations

      public void setAdminConfigurations(@Nonnull AdminConfigurations adminConfigurations)
    • balanceAsof

      public TradeAccount balanceAsof(@Nonnull String balanceAsof)
    • getBalanceAsof

      @Nonnull public String getBalanceAsof()
      The date of the snapshot for `last_*` fields
      Returns:
      balanceAsof
    • setBalanceAsof

      public void setBalanceAsof(@Nonnull String balanceAsof)
    • buyingPower

      public TradeAccount buyingPower(@Nonnull BigDecimal buyingPower)
    • getBuyingPower

      @Nonnull public BigDecimal getBuyingPower()
      Current available cash buying power. If multiplier = 2 then buying_power = max(equity-initial_margin(0) * 2). If multiplier = 1 then buying_power = cash.
      Returns:
      buyingPower
    • setBuyingPower

      public void setBuyingPower(@Nonnull BigDecimal buyingPower)
    • cash

      public TradeAccount cash(@Nonnull BigDecimal cash)
    • getCash

      @Nonnull public BigDecimal getCash()
      Cash balance
      Returns:
      cash
    • setCash

      public void setCash(@Nonnull BigDecimal cash)
    • cashTransferable

      public TradeAccount cashTransferable(@Nullable String cashTransferable)
    • getCashTransferable

      @Nullable public String getCashTransferable()
      Cash available for transfer (JNLC)
      Returns:
      cashTransferable
    • setCashTransferable

      public void setCashTransferable(@Nullable String cashTransferable)
    • cashWithdrawable

      public TradeAccount cashWithdrawable(@Nullable BigDecimal cashWithdrawable)
    • getCashWithdrawable

      @Nullable public BigDecimal getCashWithdrawable()
      Cash available for withdrawal
      Returns:
      cashWithdrawable
    • setCashWithdrawable

      public void setCashWithdrawable(@Nullable BigDecimal cashWithdrawable)
    • clearingBroker

      public TradeAccount clearingBroker(@Nullable String clearingBroker)
    • getClearingBroker

      @Nullable public String getClearingBroker()
      Clearing broker
      Returns:
      clearingBroker
    • setClearingBroker

      public void setClearingBroker(@Nullable String clearingBroker)
    • createdAt

      public TradeAccount createdAt(@Nonnull String createdAt)
    • getCreatedAt

      @Nonnull public String getCreatedAt()
      Timestamp this account was created at
      Returns:
      createdAt
    • setCreatedAt

      public void setCreatedAt(@Nonnull String createdAt)
    • cryptoStatus

      public TradeAccount cryptoStatus(@Nonnull AccountStatus cryptoStatus)
    • getCryptoStatus

      @Nonnull public AccountStatus getCryptoStatus()
      Get cryptoStatus
      Returns:
      cryptoStatus
    • setCryptoStatus

      public void setCryptoStatus(@Nonnull AccountStatus cryptoStatus)
    • currency

      public TradeAccount currency(@Nonnull String currency)
    • getCurrency

      @Nonnull public String getCurrency()
      Always USD
      Returns:
      currency
    • setCurrency

      public void setCurrency(@Nonnull String currency)
    • effectiveBuyingPower

      public TradeAccount effectiveBuyingPower(@Nonnull BigDecimal effectiveBuyingPower)
    • getEffectiveBuyingPower

      @Nonnull public BigDecimal getEffectiveBuyingPower()
      Effective buying power (duplicate of buying power)
      Returns:
      effectiveBuyingPower
    • setEffectiveBuyingPower

      public void setEffectiveBuyingPower(@Nonnull BigDecimal effectiveBuyingPower)
    • equity

      public TradeAccount equity(@Nonnull BigDecimal equity)
    • getEquity

      @Nonnull public BigDecimal getEquity()
      cash + long_market_value + short_market_value
      Returns:
      equity
    • setEquity

      public void setEquity(@Nonnull BigDecimal equity)
    • id

      public TradeAccount id(@Nonnull UUID id)
    • getId

      @Nonnull public UUID getId()
      The account ID
      Returns:
      id
    • setId

      public void setId(@Nonnull UUID id)
    • initialMargin

      public TradeAccount initialMargin(@Nonnull BigDecimal initialMargin)
    • getInitialMargin

      @Nonnull public BigDecimal getInitialMargin()
      Reg T initial margin requirement (continuously updated value)
      Returns:
      initialMargin
    • setInitialMargin

      public void setInitialMargin(@Nonnull BigDecimal initialMargin)
    • intradayAdjustments

      public TradeAccount intradayAdjustments(@Nullable String intradayAdjustments)
    • getIntradayAdjustments

      @Nullable public String getIntradayAdjustments()
      The intraday adjustment by non_trade_activities such as fund deposit/withdraw.
      Returns:
      intradayAdjustments
    • setIntradayAdjustments

      public void setIntradayAdjustments(@Nullable String intradayAdjustments)
    • lastBuyingPower

      public TradeAccount lastBuyingPower(@Nullable String lastBuyingPower)
    • getLastBuyingPower

      @Nullable public String getLastBuyingPower()
      Value of buying_power as of previous trading day at 16:00:00 ET
      Returns:
      lastBuyingPower
    • setLastBuyingPower

      public void setLastBuyingPower(@Nullable String lastBuyingPower)
    • lastCash

      public TradeAccount lastCash(@Nullable String lastCash)
    • getLastCash

      @Nullable public String getLastCash()
      Value of all cash as of previous trading day at 16:00:00 ET
      Returns:
      lastCash
    • setLastCash

      public void setLastCash(@Nullable String lastCash)
    • lastEquity

      public TradeAccount lastEquity(@Nonnull BigDecimal lastEquity)
    • getLastEquity

      @Nonnull public BigDecimal getLastEquity()
      Equity as of previous trading day at 16:00:00 ET
      Returns:
      lastEquity
    • setLastEquity

      public void setLastEquity(@Nonnull BigDecimal lastEquity)
    • lastInitialMargin

      public TradeAccount lastInitialMargin(@Nullable String lastInitialMargin)
    • getLastInitialMargin

      @Nullable public String getLastInitialMargin()
      Value of Reg T margin as of previous trading day at 16:00:00 ET
      Returns:
      lastInitialMargin
    • setLastInitialMargin

      public void setLastInitialMargin(@Nullable String lastInitialMargin)
    • lastLongMarketValue

      public TradeAccount lastLongMarketValue(@Nullable String lastLongMarketValue)
    • getLastLongMarketValue

      @Nullable public String getLastLongMarketValue()
      Value of all long positions as of previous trading day at 16:00:00 ET
      Returns:
      lastLongMarketValue
    • setLastLongMarketValue

      public void setLastLongMarketValue(@Nullable String lastLongMarketValue)
    • lastMaintenanceMargin

      public TradeAccount lastMaintenanceMargin(@Nonnull BigDecimal lastMaintenanceMargin)
    • getLastMaintenanceMargin

      @Nonnull public BigDecimal getLastMaintenanceMargin()
      Maintenance margin requirement on the previous trading day
      Returns:
      lastMaintenanceMargin
    • setLastMaintenanceMargin

      public void setLastMaintenanceMargin(@Nonnull BigDecimal lastMaintenanceMargin)
    • lastOptionsBuyingPower

      public TradeAccount lastOptionsBuyingPower(@Nullable String lastOptionsBuyingPower)
    • getLastOptionsBuyingPower

      @Nullable public String getLastOptionsBuyingPower()
      Value of option buying power as of previous trading day at 16:00:00 ET
      Returns:
      lastOptionsBuyingPower
    • setLastOptionsBuyingPower

      public void setLastOptionsBuyingPower(@Nullable String lastOptionsBuyingPower)
    • lastRegtBuyingPower

      public TradeAccount lastRegtBuyingPower(@Nullable String lastRegtBuyingPower)
    • getLastRegtBuyingPower

      @Nullable public String getLastRegtBuyingPower()
      Value of Reg T buying power as of previous trading day at 16:00:00 ET
      Returns:
      lastRegtBuyingPower
    • setLastRegtBuyingPower

      public void setLastRegtBuyingPower(@Nullable String lastRegtBuyingPower)
    • lastShortMarketValue

      public TradeAccount lastShortMarketValue(@Nullable String lastShortMarketValue)
    • getLastShortMarketValue

      @Nullable public String getLastShortMarketValue()
      Value of all short positions as of previous trading day at 16:00:00 ET
      Returns:
      lastShortMarketValue
    • setLastShortMarketValue

      public void setLastShortMarketValue(@Nullable String lastShortMarketValue)
    • longMarketValue

      public TradeAccount longMarketValue(@Nonnull BigDecimal longMarketValue)
    • getLongMarketValue

      @Nonnull public BigDecimal getLongMarketValue()
      Real-time MtM value of all long positions held in the account
      Returns:
      longMarketValue
    • setLongMarketValue

      public void setLongMarketValue(@Nonnull BigDecimal longMarketValue)
    • maintenanceMargin

      public TradeAccount maintenanceMargin(@Nonnull BigDecimal maintenanceMargin)
    • getMaintenanceMargin

      @Nonnull public BigDecimal getMaintenanceMargin()
      Maintenance margin requirement (continuously updated value)
      Returns:
      maintenanceMargin
    • setMaintenanceMargin

      public void setMaintenanceMargin(@Nonnull BigDecimal maintenanceMargin)
    • memoposts

      public TradeAccount memoposts(@Nullable String memoposts)
    • getMemoposts

      @Nullable public String getMemoposts()
      Outstanding memopost value
      Returns:
      memoposts
    • setMemoposts

      public void setMemoposts(@Nullable String memoposts)
    • multiplier

      public TradeAccount multiplier(@Nonnull BigDecimal multiplier)
    • getMultiplier

      @Nonnull public BigDecimal getMultiplier()
      \"1\", \"2\", \"3\", or \"4\"
      Returns:
      multiplier
    • setMultiplier

      public void setMultiplier(@Nonnull BigDecimal multiplier)
    • nonMarginableBuyingPower

      public TradeAccount nonMarginableBuyingPower(@Nonnull BigDecimal nonMarginableBuyingPower)
    • getNonMarginableBuyingPower

      @Nonnull public BigDecimal getNonMarginableBuyingPower()
      Non-marginable buying power (currently used for only crypto trading)
      Returns:
      nonMarginableBuyingPower
    • setNonMarginableBuyingPower

      public void setNonMarginableBuyingPower(@Nonnull BigDecimal nonMarginableBuyingPower)
    • optionsApprovedLevel

      public TradeAccount optionsApprovedLevel(@Nullable TradeAccount.OptionsApprovedLevelEnum optionsApprovedLevel)
    • getOptionsApprovedLevel

      @Nullable public TradeAccount.OptionsApprovedLevelEnum getOptionsApprovedLevel()
      The options trading level that was approved for this account. 0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.
      Returns:
      optionsApprovedLevel
    • setOptionsApprovedLevel

      public void setOptionsApprovedLevel(@Nullable TradeAccount.OptionsApprovedLevelEnum optionsApprovedLevel)
    • optionsBuyingPower

      public TradeAccount optionsBuyingPower(@Nullable BigDecimal optionsBuyingPower)
    • getOptionsBuyingPower

      @Nullable public BigDecimal getOptionsBuyingPower()
      Your buying power for options trading
      Returns:
      optionsBuyingPower
    • setOptionsBuyingPower

      public void setOptionsBuyingPower(@Nullable BigDecimal optionsBuyingPower)
    • optionsTradingLevel

      public TradeAccount optionsTradingLevel(@Nullable TradeAccount.OptionsTradingLevelEnum optionsTradingLevel)
    • getOptionsTradingLevel

      @Nullable public TradeAccount.OptionsTradingLevelEnum getOptionsTradingLevel()
      The effective options trading level of the account. This is the minimum between account options_approved_level and account configurations max_options_trading_level. 0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.
      Returns:
      optionsTradingLevel
    • setOptionsTradingLevel

      public void setOptionsTradingLevel(@Nullable TradeAccount.OptionsTradingLevelEnum optionsTradingLevel)
    • pendingRegTafFees

      public TradeAccount pendingRegTafFees(@Nullable String pendingRegTafFees)
    • getPendingRegTafFees

      @Nullable public String getPendingRegTafFees()
      Pending regulatory fees for the account.
      Returns:
      pendingRegTafFees
    • setPendingRegTafFees

      public void setPendingRegTafFees(@Nullable String pendingRegTafFees)
    • pendingTransferOut

      public TradeAccount pendingTransferOut(@Nullable String pendingTransferOut)
    • getPendingTransferOut

      @Nullable public String getPendingTransferOut()
      Cash pending transfer out
      Returns:
      pendingTransferOut
    • setPendingTransferOut

      public void setPendingTransferOut(@Nullable String pendingTransferOut)
    • portfolioValue

      public TradeAccount portfolioValue(@Nonnull BigDecimal portfolioValue)
    • getPortfolioValue

      @Nonnull public BigDecimal getPortfolioValue()
      Total value of cash + holding positions. (This field is deprecated. It is equivalent to the equity field.)
      Returns:
      portfolioValue
    • setPortfolioValue

      public void setPortfolioValue(@Nonnull BigDecimal portfolioValue)
    • positionMarketValue

      public TradeAccount positionMarketValue(@Nonnull BigDecimal positionMarketValue)
    • getPositionMarketValue

      @Nonnull public BigDecimal getPositionMarketValue()
      Real-time MtM value of all the positions held in the account
      Returns:
      positionMarketValue
    • setPositionMarketValue

      public void setPositionMarketValue(@Nonnull BigDecimal positionMarketValue)
    • previousClose

      public TradeAccount previousClose(@Nullable String previousClose)
    • getPreviousClose

      @Nullable public String getPreviousClose()
      Previous sessions close time
      Returns:
      previousClose
    • setPreviousClose

      public void setPreviousClose(@Nullable String previousClose)
    • regtBuyingPower

      public TradeAccount regtBuyingPower(@Nonnull BigDecimal regtBuyingPower)
    • getRegtBuyingPower

      @Nonnull public BigDecimal getRegtBuyingPower()
      User's buying power under Regulation T (excess equity - (equity - margin value) - * margin multiplier)
      Returns:
      regtBuyingPower
    • setRegtBuyingPower

      public void setRegtBuyingPower(@Nonnull BigDecimal regtBuyingPower)
    • shortMarketValue

      public TradeAccount shortMarketValue(@Nonnull BigDecimal shortMarketValue)
    • getShortMarketValue

      @Nonnull public BigDecimal getShortMarketValue()
      Real-time MtM value of all short positions held in the account
      Returns:
      shortMarketValue
    • setShortMarketValue

      public void setShortMarketValue(@Nonnull BigDecimal shortMarketValue)
    • shortingEnabled

      public TradeAccount shortingEnabled(@Nonnull Boolean shortingEnabled)
    • getShortingEnabled

      @Nonnull public Boolean getShortingEnabled()
      Flag to denote whether or not the account is permitted to short
      Returns:
      shortingEnabled
    • setShortingEnabled

      public void setShortingEnabled(@Nonnull Boolean shortingEnabled)
    • sma

      public TradeAccount sma(@Nonnull BigDecimal sma)
    • getSma

      @Nonnull public BigDecimal getSma()
      Value of Special Memorandum Account (will be used at a later date to provide additional buying_power)
      Returns:
      sma
    • setSma

      public void setSma(@Nonnull BigDecimal sma)
    • status

      public TradeAccount status(@Nonnull AccountStatus status)
    • getStatus

      @Nonnull public AccountStatus getStatus()
      Get status
      Returns:
      status
    • setStatus

      public void setStatus(@Nonnull AccountStatus status)
    • tradeSuspendedByUser

      public TradeAccount tradeSuspendedByUser(@Nonnull Boolean tradeSuspendedByUser)
    • getTradeSuspendedByUser

      @Nonnull public Boolean getTradeSuspendedByUser()
      If true, the account is not allowed to place orders.
      Returns:
      tradeSuspendedByUser
    • setTradeSuspendedByUser

      public void setTradeSuspendedByUser(@Nonnull Boolean tradeSuspendedByUser)
    • tradingBlocked

      public TradeAccount tradingBlocked(@Nonnull Boolean tradingBlocked)
    • getTradingBlocked

      @Nonnull public Boolean getTradingBlocked()
      If true, the account is not allowed to place orders.
      Returns:
      tradingBlocked
    • setTradingBlocked

      public void setTradingBlocked(@Nonnull Boolean tradingBlocked)
    • transfersBlocked

      public TradeAccount transfersBlocked(@Nonnull Boolean transfersBlocked)
    • getTransfersBlocked

      @Nonnull public Boolean getTransfersBlocked()
      If true, the account is not allowed to request money transfers.
      Returns:
      transfersBlocked
    • setTransfersBlocked

      public void setTransfersBlocked(@Nonnull Boolean transfersBlocked)
    • userConfigurations

      public TradeAccount userConfigurations(@Nullable AccountConfigurations userConfigurations)
    • getUserConfigurations

      @Nullable public AccountConfigurations getUserConfigurations()
      Custom user-level configuration overrides for this account. This field is always present in the response, but its value will be `null` until user-level configurations have been explicitly set for the account.
      Returns:
      userConfigurations
    • setUserConfigurations

      public void setUserConfigurations(@Nullable AccountConfigurations userConfigurations)
    • putAdditionalProperty

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

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

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