Automatically compute fixing date for a swap contract

Hello everyone.
I’m trying to model a swap contract on Strata and in the process of understanding if I can use the Strata class model for my purpose. I am able to create a swap contract with a fixed and floating leg, computing the accrual periods, but I’m having a hard time figuring how to compute the fixing date for the swap contract. Say I want it to be two days before the accrual period (which is of say 3 months). Is there a way with the Strata swap contract class model to return an array of fixing date given the accrual period size, the length of the contract, the calendar, etc.?


With Strata, you create a SwapTrade describing the trade, and then call resolve(refData) to get a ResolvedSwapTrade. The resolved trade has the dates resolved (using the holiday calendar data passed in). Thus you can access each payment period, and if you drill down you can find the fixing dates.
See also the last part of this page.

Thank you so much for your reply. I tried to dig a bit into the structures you suggested to use. I found that I can get a SwapTrade by using the .of() method of the class and passing the Swap object I already created that contains both the fixed and floating SwapLegs.
The problem I encountered is that to create the mentioned SwapTrade object that method also needs a TradeInfo object, which to be built it requires some parameters that (as it appears to me) are related to a single “trade” rather than to the entire Swap. Is that right? Should I create a TradeInfo object for each settlement? It doesn’t make much sense to me though…
Thank you.