Enum Class OrderStrategy

java.lang.Object
java.lang.Enum<OrderStrategy>
velox.api.layer1.data.OrderStrategy
All Implemented Interfaces:
Serializable, Comparable<OrderStrategy>, Constable

public enum OrderStrategy extends Enum<OrderStrategy>
Describes the order strategy that an order is a part of, i.e. how it links to other orders.

One strategy can cover more than one order; each order of the group reports the same value here. A child order also gives the id of its parent order in OrderInfo.parentOrderId (if the provider reports that id).

A provider reports this value in OrderInfo.orderStrategy. Support is optional; a provider that does not implement the field reports UNKNOWN. The consumer must always handle UNKNOWN and must not read it as SIMPLE.

Later versions of the API can add new constants. Code that reads this enum must accept an unknown value and handle it in the same way as OTHER.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    A bracket order consisting of a parent order and linked child orders, typically a profit-taking order and a stop-loss order.
    A One-Cancels-Other (OCO) group of two or more linked orders.
    A recognized order strategy that does not match any explicitly defined strategy in this enum.
    A simple, standalone order, such as LMT, MKT, STP, or STP LMT.
    Indicates that order strategy is not specified and not implemented by provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static OrderStrategy[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • SIMPLE

      public static final OrderStrategy SIMPLE
      A simple, standalone order, such as LMT, MKT, STP, or STP LMT. This strategy does not include Bracket, or other special order types (OCO for example).

      This order stands alone: it does not change the state of another order, and no other order changes its state. OrderInfo.parentOrderId is null.

      See Also:
    • BRACKET

      public static final OrderStrategy BRACKET
      A bracket order consisting of a parent order and linked child orders, typically a profit-taking order and a stop-loss order.

      Each order of the bracket reports this strategy: the parent order and each child order. A child order gives the id of the parent order in OrderInfo.parentOrderId (if the provider reports that id).

      The two children behave like an OCO pair: a fill of one cancels the other. They still report this strategy and not OCO, because the bracket created them.

      See Also:
      • AbsoluteBracketsValuesOrderSendParameters
      • BracketTier
    • OCO

      public static final OrderStrategy OCO
      A One-Cancels-Other (OCO) group of two or more linked orders. A fill of one order of the group cancels each other order of the group.

      Each order of the group reports this strategy. The orders are equal in rank; no parent order stands above them, so OrderInfo.parentOrderId is null.

      See Also:
    • OTHER

      public static final OrderStrategy OTHER
      A recognized order strategy that does not match any explicitly defined strategy in this enum.

      Use this value when the provider has a specific order strategy, but this enum has no constant for it.

      OTHER is not UNKNOWN: OTHER states that the provider knows the strategy. The consumer still cannot find the link between such orders, because this enum does not name that strategy.

      Later versions of the API can add a constant for a strategy that currently reports OTHER.

      See Also:
    • UNKNOWN

      public static final OrderStrategy UNKNOWN
      Indicates that order strategy is not specified and not implemented by provider. Should be treated as any possible of the above strategies.

      This is the default value of OrderInfo.orderStrategy; many providers can report it, because support for this field is optional.

      The value gives no information about the order: an order with UNKNOWN can still be a bracket child or a member of an OCO group. Do not read UNKNOWN as SIMPLE.

      Code that needs the strategy must use another source. If no such source exists, the code must work in the same way for each strategy.

  • Method Details

    • values

      public static OrderStrategy[] 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 OrderStrategy 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