Class ExpirationDate


  • @Deprecated
    public class ExpirationDate
    extends OrderValidityDate
    Deprecated.

    The date an order should expire. This can be a recognised string from a backend trading system just as GFD (Good for Day) or can be a date and time with a location or UTC offset.

    • Field Detail

      • FOK

        public static final ExpirationDate FOK
        Deprecated.
        An instance of ExpirationDate that represents Fill or Kill.
      • IOC

        public static final ExpirationDate IOC
        Deprecated.
        An instance of ExpirationDate that represents Immediate or Cancel.
      • GTC

        public static final ExpirationDate GTC
        Deprecated.
        An instance of ExpirationDate that represents Good til Canceled.
      • GFD

        public static final ExpirationDate GFD
        Deprecated.
        An instance of ExpirationDate that represents Good for Day.
    • Constructor Detail

      • ExpirationDate

        public ExpirationDate​(String date,
                              String time,
                              String location,
                              String offset)
                       throws OrderConfigurationException
        Deprecated.

        Constructs a GTD (Good til Date) ExpirationDate which represents a specific date, time and location. If you don't want a GTD expiration date, you can use one of the static instances provided as fields on this class:

        Parameters:
        date - The date as string in the format "YYYYMMDD".
        time - The time as string in the format "HH:MM:SS".
        location - The location pertaining to the date and time the order should expire. This can either be an entry in the tz database such as "Europe/London", or the string "LOCAL" (OrderValidityDate.LOCAL).
        offset - The UTC offset if the location was specified as "LOCAL", i.e local to the user. If a specific location is provided then this value must be null, because the offset can be inferred from the date, time and location.
        Throws:
        OrderConfigurationException - If any of the criteria specified by OrderValidityDate.parse(String, String, String, String) are not met. In particular, make sure you only provide a location or an offset, but not both. One of those two parameters must be null, or an exception will be thrown.
    • Method Detail

      • isGoodTillCanceled

        public boolean isGoodTillCanceled()
        Deprecated.
        A 'Good Till Canceled' expiration means that the order should stay in effect until the client decides to cancel it.
        Returns:
        A boolean representing whether or not the expiration of the order is 'Good Till Canceled' (GTC)
      • isGoodForDay

        public boolean isGoodForDay()
        Deprecated.
        A 'Good For Day' expiration means that the order should stay in effect until the end of the trading day, at which point the order should be canceled by the back end system.
        Returns:
        A boolean representing whether or not the expiration date is 'Good For Day' (GFD)
      • isGoodTillDate

        public boolean isGoodTillDate()
        Deprecated.
        A 'Good Till Date' expiration means that the order should stay in effect until the date and time specified by the client. s
        Returns:
        A boolean representing whether or not the expiration date is 'Good Till Date' (GTD)
      • isFillOrKill

        public boolean isFillOrKill()
        Deprecated.
        A 'Fill or Kill' expiration means that the order must immediately be fully filled by the backend trading system, or it should be canceled.
        Returns:
        A boolean representing whether or not the expiration date is 'Fill or Kill' (FOK)
      • isImmediateOrCancel

        public boolean isImmediateOrCancel()
        Deprecated.
        An 'Immediate or Cancel' expiration means that the order must be at least immediately partially filled by the backend trading system, or it should be cancelled.
        Returns:
        A boolean representing whether or not the expiration date is 'Immediate or Cancel' (IOC)
      • getDateFieldValue

        public String getDateFieldValue()
        Deprecated.