/** * Creates an currency position key. Note that account and traderId are * converted to null if they only contain whitespace. * * @param baseCCY * baseCCY, cannot be null or whitespace * @param plCCY * plCCY, cannot be null or whitespace * @param nearTenor * nearTenor, cannot be null or whitespace * @param account * account * @param traderId * trader id * @throws IllegalArgumentException * if symbol is null or whitespace */ public static PositionKey<Currency> createCurrencyKey(String symbol, @Nullable String account, @Nullable String traderId) { return createKey(new Currency(symbol), account, traderId); } /**
/** * Creates a currency position key. Note that account and traderId are * converted to null if they only contain whitespace. * * @param baseCCY a <code>String</code> value * @param plCCY a <code>String</code> value * @param nearTenor a <code>String</code> value * @param farTenor a <code>String</code> value * @param inAccount a <code>String</code> value * @param inTraderId a <code>String</code> value * @throws IllegalArgumentException if one of the given parameters are invalid */ public static PositionKey<Currency> createCurrencyKey(String baseCCY, String plCCY, String nearTenor, @Nullable String farTenor, @Nullable String inAccount, @Nullable String inTraderId) { return createKey(new Currency(baseCCY, plCCY, nearTenor, farTenor),inAccount, inTraderId); } /**
/** * utility method to invert the ccypair and return a new instrument * eg for Currency Pair EUR/USD, returns USD/EUR * * WARN: inverse MAINTAINS the tradedCCY field * * @return */ public Currency inverse(){ Currency inverse = new Currency(this.rightCCY,this.leftCCY,this.nearTenor,this.farTenor); inverse.setTradedCCY(this.getTradedCCY()); return inverse; }
} catch (IllegalArgumentException ignored) {} if(inSymbol.contains("/")) { //$NON-NLS-1$ return new Currency(inSymbol);
new Currency(inSymbol)); StrategyModule.log(LogEventBuilder.debug().withMessage(RECEIVED_POSITION, String.valueOf(strategy),