@Override public Instrument resolveSymbol(String inSymbol) { return new Equity(inSymbol); } /* (non-Javadoc)
@Override public int compare(Equity o1, Equity o2) { return new CompareToBuilder(). append(o1.getFullSymbol(), o2.getFullSymbol()).toComparison(); } }
/** * Gets the instrument value as a <code>String</code>. * * @return a <code>String</code> value or <code>null</code> */ public String getInstrumentAsString() { if(equity == null) { return null; } return equity.getSymbol(); } /**
return false; } else if (!equity.equals(other.equity)) { return false;
/** * Sets the symbol sfx field on the instrument if the FIX dictionary supports the symbol field and the instrument has a non-null value. * * @param inInstrument an <code>Instrument</code> value * @param inDictionary a <code>DataDictionary</code> value * @param inMsgType a <code>String</code> value * @param inMessage a <code>FieldMap</code> value */ protected static void setSymbolSfx(Instrument inInstrument, DataDictionary inDictionary, String inMsgType, FieldMap inMessage) { if(inDictionary.isMsgField(inMsgType, quickfix.field.SymbolSfx.FIELD)) { Equity equity = (Equity)inInstrument; if(equity.getSymbolSfx() != null) { inMessage.setField(new quickfix.field.SymbolSfx(equity.getSymbolSfx())); } } } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((amount == null) ? 0 : amount.hashCode()); result = prime * result + ((currency == null) ? 0 : currency.hashCode()); result = prime * result + ((declareDate == null) ? 0 : declareDate.hashCode()); result = prime * result + ((equity == null) ? 0 : equity.hashCode()); result = prime * result + ((executionDate == null) ? 0 : executionDate.hashCode()); result = prime * result + ((frequency == null) ? 0 : frequency.hashCode()); result = prime * result + ((paymentDate == null) ? 0 : paymentDate.hashCode()); result = prime * result + ((recordDate == null) ? 0 : recordDate.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); result = prime * result + ((eventType == null) ? 0 : eventType.hashCode()); return result; } /* (non-Javadoc)
if(!dividendEvent.getInstrument().equals(getUnderlyingInstrument())) { WRONG_DIVIDEND_EQUITY_FOR_OPTION_CHAIN.warn(OptionChain.class, dividendEvent.getInstrument(), if(!equityEvent.getInstrument().equals(getUnderlyingInstrument())) { WRONG_EQUITY_FOR_OPTION_CHAIN.warn(OptionChain.class, equityEvent.getInstrument(),
@Override public void set(Instrument inInstrument, String inBeginString, FieldMap inMessage) { setSecurityType(inInstrument, inBeginString, inMessage); inMessage.setField(new Symbol(inInstrument.getSymbol())); if(inInstrument instanceof Equity) { Equity equity = (Equity)inInstrument; if(equity.getSymbolSfx() != null) { inMessage.setField(new quickfix.field.SymbolSfx(equity.getSymbolSfx())); } } }
/** * Creates an equity position key. Note that account and traderId are * converted to null if they only contain whitespace. * * @param symbol * symbol, cannot be null or whitespace * @param account * account * @param traderId * trader id * @throws IllegalArgumentException * if symbol is null or whitespace */ public static PositionKey<Equity> createEquityKey(String symbol, @Nullable String account, @Nullable String traderId) { return createKey(new Equity(symbol), account, traderId); } /**
@Override public Instrument extract(FieldMap inMessage) { String symbol = getSymbol(inMessage); String symbolSfx = getSymbolSfx(inMessage); return symbol == null ? null : new Equity(symbol, symbolSfx); } /* (non-Javadoc)
new Equity(inSymbol)); StrategyModule.log(LogEventBuilder.debug().withMessage(RECEIVED_POSITION, String.valueOf(strategy),
if(instrument instanceof Option) { bidBuilder.withExpirationType(ExpirationType.UNKNOWN); bidBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol())); if(instrument instanceof Option) { askBuilder.withExpirationType(ExpirationType.UNKNOWN); askBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol())); if(instrument instanceof Option) { tradeBuilder.withExpirationType(ExpirationType.UNKNOWN); tradeBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol())); marketstatBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol()));
if(instrument instanceof Option) { bidBuilder.withExpirationType(ExpirationType.UNKNOWN); bidBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol())); if(instrument instanceof Option) { askBuilder.withExpirationType(ExpirationType.UNKNOWN); askBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol())); if(instrument instanceof Option) { tradeBuilder.withExpirationType(ExpirationType.UNKNOWN); tradeBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol())); marketstatBuilder.withUnderlyingInstrument(new Equity(instrument.getSymbol()));