/** * Obtains a template based on the specified period and index. * * <p>The period from the spot date to the start date is specified. The period from the spot date * to the end date will be the period to start plus the tenor of the index. * * <p>For example, a '2 x 5' FRA has a period to the start date of 2 months. The index will be a 3 * month index, such as 'USD-LIBOR-3M'. The period to the end date will be the period to the start * date plus the index tenor. * * @param periodToStart the period between the spot date and the start date * @param index the index that defines the market convention * @return the template */ public static FraTemplate of(Period periodToStart, IborIndex index) { return of( periodToStart, periodToStart.plus(index.getTenor().getPeriod()), FraConvention.of(index)); }