Class ExpirationDate
- java.lang.Object
-
- com.caplin.motif.fx.trading.orders.submission.OrderValidityDate
-
- com.caplin.motif.fx.trading.orders.submission.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 Summary
Fields Modifier and Type Field Description static ExpirationDate
FOK
Deprecated.An instance of ExpirationDate that represents Fill or Kill.static ExpirationDate
GFD
Deprecated.An instance of ExpirationDate that represents Good for Day.static ExpirationDate
GTC
Deprecated.An instance of ExpirationDate that represents Good til Canceled.static ExpirationDate
IOC
Deprecated.An instance of ExpirationDate that represents Immediate or Cancel.-
Fields inherited from class com.caplin.motif.fx.trading.orders.submission.OrderValidityDate
DATE_PATTERN, dateStr, datetime, isLocal, LOCAL, location, offset, timeStr, ZEROED_OFFSET
-
-
Constructor Summary
Constructors Constructor Description ExpirationDate(String date, String time, String location, String offset)
Deprecated.Constructs a GTD (Good til Date) ExpirationDate which represents a specific date, time and location.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
Deprecated.String
getDateFieldValue()
Deprecated.int
hashCode()
Deprecated.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.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.boolean
isGoodTillCanceled()
Deprecated.A 'Good Till Canceled' expiration means that the order should stay in effect until the client decides to cancel it.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.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.static ExpirationDate
parseFromValues(String date, String time, String location, String offset)
Deprecated.String
toString()
Deprecated.-
Methods inherited from class com.caplin.motif.fx.trading.orders.submission.OrderValidityDate
getDateAsString, getDateTime, getLocation, getOffset, getTimeAsString, isLocal, parse
-
-
-
-
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 byOrderValidityDate.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
-
parseFromValues
public static ExpirationDate parseFromValues(String date, String time, String location, String offset) throws OrderConfigurationException
Deprecated.- Throws:
OrderConfigurationException
-
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.
-
equals
public boolean equals(Object o)
Deprecated.- Overrides:
equals
in classOrderValidityDate
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classOrderValidityDate
-
toString
public String toString()
Deprecated.- Overrides:
toString
in classOrderValidityDate
-
-