Enum Class TradingEnvironment

java.lang.Object
java.lang.Enum<TradingEnvironment>
markets.alpaca.client.ws.TradingEnvironment
All Implemented Interfaces:
Serializable, Comparable<TradingEnvironment>, Constable

public enum TradingEnvironment extends Enum<TradingEnvironment>
Selects between the Alpaca live and paper trading WebSocket endpoints.

Note: on the paper endpoint, trade_updates messages are sent as binary frames. The client handles this transparently by decoding them as UTF-8 text.

  • Enum Constant Details

    • PRODUCTION

      public static final TradingEnvironment PRODUCTION
      api.alpaca.markets — live brokerage account updates.
    • PAPER

      public static final TradingEnvironment PAPER
      paper-api.alpaca.markets — paper trading account updates.
  • Method Details

    • values

      public static TradingEnvironment[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TradingEnvironment valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • url

      public String url()
      Returns the full WebSocket URL for this environment.