I need to define special tenors for FX such as: ON(overnight), TM(tomorrow), TMN(2D), SP(spot),SPN(spot next) where the period is a function of the currency (or currency pair). Currently the Tenor class is marked final and is not an extended enum. Is there an alternative in Strata for representing these tenors? For example I can’t use Tenor_2D for spot since CAD,RUB (and some others) have a 1D spot. Similarly, SPN would be either 2 or 3 business days depending on the currency.
FxSwapConvention and its implementation has a method
getSpotDateOffset() which is intended to capture the offset to the spot date for some currencies. There isn’t an
FxSingleConvention at present. I think a convention best represents the data here - what you want is a factory that can create each of the FX types listed above, eg.
convention.createSpotNext(tradeDate). There might then need to be a separate
SpotTenor class to represent the tenor concepts (as they are not just a day).
As we tend to process pre-existing trades, rather than creating them from scratch, we haven’t run into this particular problem.
Hope that helps