In my quest for simulated data, I am trying to generate prices for Total Return Swaps by calculating the NPVs of the fixed and floating leg. My problem: Given the fixed leg, how do I set the spread on the floating leg so that the value of the swap at the beginning equals Zero?
On a more technical side: Using RQuantLib, I use FloatingRateBond to calculate the NPV. How exactly do I set the spread there? The documentation is a bit unclear at that point.