Printing PV and PnL series results in csv format

I am trying to report PV and PnL series for IRS trades in csv format
for PV i see that i could add something like this to the ini file

value = Measures.PresentValue

But for PnL series i cannot do the same.

Whats the best way of doing this?

Strata does not have built-in support for PnL at this point, which is why you do not see a measure that you can just use in the reporting ini file.

We do however have an example - HistoricalScenarioExample - that shows how to use Strata’s scenario capability to get PnL and output it to the console.

Hope that helps.

yes, i am using that example and calculating the pnl series,
to report it though i have to generate pv results and pnl series in 2 separate requests and then end up combining the two manually and send it to the report writer
i also had to override the formatters to allow formatting of CurrencyValueArray which represents the pnl series.

that being said how soon can we expect this functionality in Strata and is there a better way of doing it?

You are correct that the report writer is not currently designed to output multi-scenario results like CurrencyValuesArray.

Strata is intended to be used as a toolkit, so calling the calculation runner twice to get PV and historical PVs is not unreasonable from out perspective. Feel free to describe the API you’d like to see however, and we’ll try to work out if it makes sense to add it.

I am ok with the API, the only reason i have to go through this is that PnL series is not a measure like PV
and there is no way to print out results for PnL Series.
for my persepective the end result would be to add in PnL series as a measure to the ini file and the rest of the flow stays as is, so i do not have to call function 2 times and manually stitch together pnl and pv results.


following up on this thread, with 1.0.0, would the problem described above be remedied?


Version 1.0 did not change this thread.

The issue is that the reporting framework that outputs the CSV is based on the principle of outputting data from a single scenario run. Whereas, Strata would produce PnL by using one scenario for each date, thus the output will not easily fit into the existing reporting framework.

Note however that Strata can produce the PnL series that is desired - it is just a little trickier to visualize it that with other measures.