public class OCOStrategy extends MotifOrderStrategy
Represents the contingent order strategy One Cancels the Other.
The structure of this order is defined as:orders
trade
Constructor and Description |
---|
OCOStrategy(com.caplin.trading.Trade trade,
TradingSubProtocol tradingSubProtocol,
String currencyPair,
String user,
String toboUser,
String remarks,
Set<AlertType> alertTypes,
String requestId,
String account,
List<Order> orders,
ActivationDate activationDate,
ExpirationDate expirationDate)
Creates a new OCOStrategy from the provided parameters.
|
Modifier and Type | Method and Description |
---|---|
Order |
getStopLossOrder()
Returns the stop loss child order from within the OCO.
|
Order |
getTakeProfitOrder()
Returns the take profit child order from within the OCO.
|
getAccount, getActivationDate, getAlertTypes, getChildOrders, getCurrencyPair, getExpirationDate, getPendingAcceptResponder, getQueuedResponder, getRemarks, getSpotRateDPS, getSubmittedResponder, getTOBOUser, getTradingSubProtocol, getType, toString
getCurrentState, getField, getRequestID, getTradeChannelSubject, getUsername
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRequestID, getUsername
public OCOStrategy(com.caplin.trading.Trade trade, TradingSubProtocol tradingSubProtocol, String currencyPair, String user, String toboUser, String remarks, Set<AlertType> alertTypes, String requestId, String account, List<Order> orders, ActivationDate activationDate, ExpirationDate expirationDate)
trade
- The underlying Trading DataSource trade object containing the raw field map that this strategy will be built from.tradingSubProtocol
- The trading sub protocol, used to determine small variations of OrderStrategy.currencyPair
- The currency pair for the strategy. All child orders in an OCO strategy are expected to relate to the same currency pair.user
- The user who submitted the strategy.toboUser
- The trade on behalf of user.remarks
- The contents of the free text remarks field for the strategy, for example "Call this number when the order fills".alertTypes
- A set of AlertType
s that should be used when the order fills, for example SMS or email.requestId
- The client-generated ID for the strategy.account
- The account that the strategy relates to.orders
- A list of child orders that make up the strategy. The ordering in the list is important. The first child order in the list must
be the stop loss order, and the second order in the list must be the take profit order; otherwise the getStopLossOrder()
and getTakeProfitOrder()
methods will not work correctly. There should never be more or less than two orders in the list.activationDate
- The date on which this strategy should become active in the market.expirationDate
- The date on which this strategy should expire.Copyright © 2015 Caplin Systems.