PL reports – solutions

Shazmd asked a question through the forum about how to make a report giving out PL as of 3 dates.

There are couple of solutions to this question and which one you need to use is totally up to you πŸ™‚

First thing to keep in mind is that when people mention reports it should not always equal datamart. For instance, simulation is a live report showing the risk and which could fetch data as of couple of days in the past.

Trade query is also in a way a report, with no calculated data. So it is important to understand what is the end user after so you give him/her the most appropriate solution.

  1. User definable P&L notepad

This first solution is probably the simplest and is perfect if the request is just a one off that would not repeat very frequently. User definable notepad is a dynamic table based on PL, there is just a direct menu to access it. So if you search for it (it is under middle office, P&L related procedure (or just type in the search notepad)) and get into it, Murex will ask you to choose a filter. Space bar on the default one. You then see a filter screen. You have 3 dates you can choose from (Inception means not calculated) and you can pick a portfolio or any other criteria. The data for the 3 dates will be computed when you validate the filter.

You then get a matrix will all the deals selected and the data you need. Just change the view to be what you need using Tools-View and choose the columns which make sense. You will see some fields available 3 times, they are the data computed as of the 3 different dates. Just change from description to field name. The field ending in 0 corresponds to the data for the first date selected, the one ending in 1 corresponds to the data for the 2nd date selected and the last one ending in 2 corresponds to the data for the 3rd date selected.

You can then copy paste (ctrl-shift-C to copy all lines) the results or export them from the file menu. You can then work out the data in Excel.

2. Datamart

Datamart for 3 PL dates is the 2nd solution. It is easy to re-use and the format will be up to you.

First of all, you need to choose which engine to use for computing the data (note that it is using the same code underneath but there could be differences in usage). The first one is a dynamic table of type PL (TRNRP_PL). You need to define one and choose the fields you want. Remember that you can test a dynamic table to check if the content is ok. The dynamic table should produced only 1 set of PL result not 3.

Once you’re happy with the dynamic table, you need to wrap it so that it will produce data into the datamart. To do so (and in high speed): you will need to define a feeder and then inject that feeder into a batch of feeders. The feeder will go through creating a table in the datamart and attaching data to it (data coming from your dynamic table). When you define your batch of feeders make sure that you can have at least 1 set per date so that data in the datamart is historized.

Just run the batch of feeders as of the 3 dates you need to compute (you might need to amend the global filter within the batch of feeders to choose which date). Β Once your datamart is populated with the data (you can query it and check by SQL for example). You need to build an extraction to retrieve that data. The extraction will be an SQL piece of code which you can make fancy by letting the user choose the 3 dates he wants to query on (or you can hardcode it).

Finally, you need to format the output, csv file format requires no work, but if the user wants to look at the results on screen you’ll need to have a viewer with your field to be nicely formatted. I usually don’t recommend to format the excel file via the viewer as dates come back sometimes not as wanted, or fields formatting might require extra work.

And that’s it you’ve got a datamart with your 3 dates. The first time you will do it, you will get it wrong and it will take some time but once you start getting the hang of it, it becomes much much smoother.

3. Simulation

And yes there is another option: simulation. Simulation is a live report showing live position, cash flow, PL, etc… In simulation, build a viewer to show your PL with as much breakdown as you would like.

You can then define a dynamic table based on that simulation view. Create a feeder and batch of feeder on top. Then compute the PL data as of the 2 days in the past you need. Simulation will always compute PL as of today.

Then back in your simulation view, you can add more of the same PL fields and right click on them, output settings and select stored data. You can then choose to retrieve the data from your datamart directly in simulation and display either the datamart number or the variation with the current data. You can also choose to retrieve based on a shifter (like the day before, 1 month before, first day of the month, etc…) and you can do it as many times as you like (and as you have data of course!).

In a nutshell, that’s how you can solve your problem of a report showing PL as of 3 dates. I am sure you will have tons more questions, feel free to experiment, check your environment for already existing examples and ask here if you’re stuck!

12 thoughts on “PL reports – solutions”

  1. Thanks mate for such a nice explanation. I will practice the same solutions and will get to back to u with queries πŸ™‚

  2. What is the difference between the different creation class under Transaction ie. TRNRP_PL,TRNRP_CS,TRNRP_MV,TRNRP_XG,TRNRP_Sv.

    And what is meant by EOD ? What are the necessary steps done for EOD ?

    1. TRNRP_PL is for PL date (you get a series of fields starting with PL).
      CS is for cash flows. You get a series of fields starting with F_. Note that creation class is very important for CS as it determines if you want to see past cash or future cash and if the future cash flows need to be estimated.
      XG is for fixing, SV for sensitivities.

      End of day jobs vary a lot depending on what you are using Murex for. Depending on the modules or the needs. Murex will help you sort out the steps you need as part of the implementation process.

  3. Thanks for the above info.

    Can you please let me know how to optimise the Batch of feeders and how to optimise the stored procedures ?

    And also how to see live trades in simulation view ?

    1. Hi,
      There are 3 types of optimization for batch of feeders:
      – Scanner template. For the BoF using dynamic tables, you can choose a scanner template. The scanner template will split the work among a certain number of engines (or slaves) and everytime give them a certain number of trades to process. Usually PAC will recommend a default level for the scanner template, but you can also experiment. Having a number of engines equal to the number of CPUs they can use is usually a good start. Then the number of trades to be processed will depend on your exoticness. If you have significant number of exotics, 50 might be good for you (You need to try and compare!) or no exotic , 250-500?
      – Running them in parallel, on top of the scanner template you could also run BoF in parallel to maximize your hardware usage
      – Finally, you might want to look into which data they are storing in the DM. If there is some redundancy (especially in calculations), might be worth checking if there is an easy way to redesign your datamart.

      As for stored procedures, if you are referring to Sybase or Oracle, then I could only repeat what I was told : try to avoid cursors. But you would not run stored procedures regularly anyway so if it takes 20 minutes instead of 5, that should not be an issue anyway. Except if you are referring to something else?

      1. Thanks for the info it was really help ful.

        Can you please let me know how to see live data through simulation view ?

        1. Hi Kumar,
          If you opened the simulation through Portfolio simulation detailed or conso (Not as of past date or user definable), your simulation will update whenever you have new trades provided you used views with some standard fields (such as PL, cash flows, etc…). All MXpress views should be good to go.
          All simulations can refresh upon live market data change if you have compute on.

          Short version: if you opened a portfolio simulation: you are looking at live data. The only exception: if you forced each viewer field to retrieve datamart data.

          1. Hi Guys

            i am new in reporting in MX.
            is anybode there who could send me a report doc?

            thanks so much, george, switzerland

          2. Hi George,

            All documentation is copyrighted by Murex. You need to get it from them.

            Manu

  4. Hi Manu, thanx!

    Is nowhere a place for newcomers to read the docs?

    rg, George

    1. If you’re already embedded in a Murex project, you should already get access to their online documentation.
      Otherwise you can contact Murex directly to check training availabilities.

      Best of luck,

      Manu

Comments are closed.