Category Archives: Tips

Reconciliation or rec – what should I do for my trades

Whenever migrating or updating, one task will consume a fair bit of manpower: reconciliation.

When doing trade reconciliation, the following is to be checked:

– Financial trade details reconciliation. This is usually the first one as it will be used afterwards as the key for reconciliation. In that task, you ensure that trade numbers, deal type, price/rate, portfolio, etc… all the data considered financial is correct.

– Cash flow/P&L/Sensitivities. You normally need to rec all 3. In my experience, it tends to be better to start with P&L (less figures to check, 1 trade 1 number). Then move on to Cash flows, depending on the DB side, you sometimes need a very good tool capable of handling loads and loads of lines. Finally sensitivities. For that one, I would recommend against trade by trade reconciliation. It is too demanding, use a top down approach.

– Non financial reconciliation. This one is a bit up to you. If you have some reports which extract that data, this reconciliation could be considered done. If you do not reconcile it (or even fully) this is the kind of data that can be easily updated post go live.

Reconciliation is a very heavy task. It is demanding in manpower and you need people comfortable with the both applications (the old and new ones). It is as essential to have a good tool capable of assigning defects to trades matching a certain pattern and to re-apply the root causes when performing another rec.

While I don’t think anyone really enjoys doing reconciliation and browsing through lines and lines of breaks, it is an excellent exercise. I often included more junior people to the task as it gave them a chance to go through the different screen, understand how different figures are being calculated. Of course, you cannot leave them alone to do it but they can contribute to the effort and afterwards they will have built a good understanding of the issues and the application which is perfect if they need to support it going forwards.

Feel free to share your tips and bits about reconciliation!

Datamart fun

Datamart is a great tool in Murex but it also quite confusing as to how to use it and make the most out of it. As always, your Murex consulting team is the best source of advice.

The process to produce reports is usually the following:

  1. Define Simulation view with the data you want to retrieve
  2. Define a Dynamic table based on that Simulation view (note that you could base a dynamic table directly on TRNRP_PL or TRNRP_CS for instance)
  3. Define a feeder on that dynamic table  (this will store the results into the reporting DB)
  4. Then use an extraction to retrieve the data from the reporting DB into a viewer.

The feeder can also source data from Murex tables or from other reporting tables. You’ll just have to build a map of the data you need and how to best access it. The feeders with SQL can retrieve data from different tables.

The advantage of using the simulation view as the source is that you can easily add fields and in a way do some WYSIWYG (what you see is what you get).

Now when designing reports, it is important to decide how frequently you would need to run the reports. For instance, if your feeders call upon other reporting tables, these ones won’t be refreshed. So re-running the reports on request is probably not always possible. Again it depends on your setup. If you’re simply sourcing from a dynamic table then it won’t apply to your case, but again each reporting setup is different.

Now one of the best feature of the reporting in Murex is the job recovery. If some of your report generation fail, from the job recovery you can re-run the report on the failed subset.
It might take many iterations but in the end you will end up with the failed trades. You can then exclude the failed trades or investigate them.

It can be used as a great tool to test if the EOD will run ok and zero on the trades that might cause issue.

Then of course, once you have your datamart running and all is good, what you need to build is the proper view/layout but that’s a different lesson.

What about you? Any good tip to share?

Naughty naughty spreads

It happened to me (again!) yesterday. The curve spreads are naughty naught critters!

Let’s explain:

In some cases, the curve spread indicator (the small 1 or 2 on the left of the market quote) is sometimes bugged and does not work properly. Usually nothing to worry about as it is quite easy to see if there are spreads or not (just need to play with the combo box on the far right).

Unfortunately when you’re working on a new environment or with rates which source is not clear to you, they’re not always your first target.

So what happened? (I know this story is more thrilling than a Stephen King book (yep, just compared myself to Stephen King just like that))

Basically a curve was not calibrating and I followed my previous post steps to understand what was going on. Removing curve spreads, reducing the number of instruments (the quotes were ok). Finally it was calibrating to a crazy rate (-50%). Could not understand why, market quote was correct. Tried to overtype the zero rate and got a crazy market quote.

As the instrument had the market quote as a margin on the secondary I was suspecting that something was amiss there. The pricing maybe was reading incorrectly the margin. Started to look at other curves to see if the problem was there as well, but everything was ok.

So went back to my curve and somehow (imagine a spot light above my head) started to check my curve spreads! Et voila, eureka moment, there were convexity spreads (in the range of -50%). Zeroing them brought everything back inline, the curve calibrated ok, problem solved.

As usual with these kinds of problems, even if you’re proud to have solve the issue, you always feel bad not to have checked the guilty part first!

What about you dear reader? Any similar experience?

Rate curves more tips

Rate curves how often did you get the dreaded message: Could not compute mid rates for curve XXX. As rate curves are so important, you can expect that everything else fails: pricing, simulation, some other market data calibration, accounting, etc… In a nutshell, you need to fix that rate curve problem ASAP!

When a curve fails to calibrate there could be different issues: one instrument in the curve is not sensitive to the curve, instruments have a price of 0 and 0 is not an accepted rate, your curve relationship is so complex that you cannot reach a solution within 30 iterations.

Whenever a curve is not calibrating, it is important to open the instruments in the rate curve and check that you get properly 0 NPV for all of them. You cannot do it for Futures (or contango or Fx swaps), so you’ll have to assume that they work. If you get an instrument with a non 0 NPV, then either you found the culprit or you have an arbitrageable curve. In the later case, if you were not doing something completely crazy, that’s a defect as curves are basically solved so that all instruments have a 0 NPV.

When you found the instrument(s) you should have a look at it and wonder how should it be sensitive to the curve that currently fails calibrating: discounting? Estimation? If estimation, you can go to rate details on the flow screens and check that you properly see the curve name. If for discounting, you can check in the pricing the assigned curve and also the solved value in the discounted flows. Usually it is quite clear to see which one fails.

Once you found it, go to the rate curve assignment and assign that instrument for discounting or estimation onto the curve. 95% of the time that fixes the issue. And if the calibration fails in production (assuming it was working before), I’d do pretty much the same except that I would first check the market rates fed in (in case you have something with very incorrect values).

The problem of rate curves not calibrating gets tougher when you have multiple rate curves calibrating at once. We already posted on such structure previously and I have to say I rarely saw any calibration issue when the system was used correctly. I have to say that when you’re trying some advanced curve relationship, first of all, inform Murex as you will need their help; secondary you can expect some calibration failure. But again zooming on the instrument and checking estimation and discounting is always the basic thing to do.

One thing you have to be wary of is when the instrument you use is sensitive to the curve only by its indexation. I had some hit and miss (more hits in the recent versions) but when you get to that point it is more workarounds for matching an existing rate building process rather than a financial reason for doing.

If you have tips, info or question, feel free to ask below!

SECDATA, BONDDATA

Secdata, bonddata are two very useful functions in Murex for retrieving security data, date of next coupons, yield to price conversion, etc… The problem is that they’re not always easy to use. So get your documentation nearby as you’ll need it with these functions.

How to use them?

They basically require 3 inputs: (string,date,string). The first string is the description of the security you wish to use: Market and security label most of the time and you need to add the expiry label for futures. You need to separate the market and the security with a comma in the string.

For instance “Market,Label” works, “Market”,”Label” would basically make Murex believe that you’re trying to input “Label” into the date field.

So usually TP_SECMKT+’,’+INSTRUMENT would give you the right argument for the first string.

For the date, that should be no problem! 🙂

For the third one, refer to the documentation and you should be all set.

Alright, so now you have a working secdata (or bonddata) function and it all seems good. Unfortunately it is not so simple and here’s the SECDATA pitfall:

If you call SECDATA or BONDDATA while parsing non security instrument, it will return an error message with something such as XXXX security not found (where XXXX is the label of your instrument). This is especially the case where you have swaps, deposits, anything basically that is not security related.

If you try to use an IIF statement to avoid the problem, the error message will pop up anyway: IIF(TRN_GRP==’BOND’,SECDATA function,0). The reason is that Murex evaluates all arguments of an IIF statement even if the boolean is false.

So, are you doomed with error messages? No! You just need to create another horizontal field which will become the first string argument:

H_SECURITY –> IIF(TRN_GRP==’BOND’,TP_SECMKT+’,’+INSTRUMENT,”).

And then you use the IIF statement again (especially if you need to return something specific when it’s not a security):

IIF(TRN_GRP==’BOND’,SECDATA(H_SECURITY,date,desired functionality),0)

So that’s how you can call upon SECDATA and BONDDATA when loading a portfolio not entirely made up of securities. This being said, I would recommend to look at already existing fields in the dynamic table to see if you can do without SECDATA or BONDDATA. Accruals being negative to see if the bond is in ex-div, MP_UPPRC for the current price, etc…

If you faced other problems or if you want to share any other trick with these 2 functions, feel free to!

Exporting a browse screen – The best way

Murex has many browse screens: trade query, accounting journal, payment query, etc… And associated with these screens comes the question: how do I get that information outside Murex?

There are multiple ways of doing it but there is a first question to answer: what do you need it for?

Exporting a browse screen on a regular basis

If you indeed after a browse screen exported on a regular basis, a report is probably the better solution for you. You have multiple options:

  • Rebuilding the browse in a viewer and making a dynamic table on it (I would not recommend that solution expect if you have another use for the viewer).
  • Re-selecting the fields you need from a standard TRNRP_PL (or whichever appropriate) dynamic table. This is good if you’re after some calculated fields which are not always available in the browse directly (How many times did I get the request to have PL figures along with the trade query)
  • Building the report using a copy creation of the table your browse is based on. It might not work in every case but for trade query it does work fine. Just reselect the fields you need from the table and/or the related tables and you’re all set

Reports can be automated during EOD and produce data automatically.

Exporting a browse screen on an adhoc basis

This one is probably where I can help you most.

There are 2 main ways of doing it. The first one is to use the classic windows shortcuts: Ctrl-A (select All), Ctrl-C (Copy) and then Ctrl-v (Paste) into excel/word. Good old classic. Never disappoints and always work.

The classic way is great especially if you have a limited amount of data to copy. It gets trickier when you start to have multiple pages (usually more than 300 lines). More Murex proficient people will tell you to use Ctrl-Shift-C and voila, all columns copied regardless of the number of pages. While it does work, be very careful.
One evening, I was leaving a customer site a bit late and could see someone still at his desk. That person needed to export that data and used Ctrl-Shift-C and the pop up window Copying was still there. The problem of Ctrl-Shift-C is that it loads all the data from the server to your computer clipboard. If the amount of data is too large for your memory, the java process might run out of memory and while you believe something is still happening, it is in complete limbo. And you don’t want to waste your evening because of that!

So here’s the better solution when the amount of data is large: File-Export… The export data lets you export all data to a file (on your computer). You can choose to export all pages and it will do it by itself leaving you with a csv file in your client directory.

Somehow, while this function is much more reliable than Ctrl-Shift-C, it is quite unknown. Maybe because nowadays everyone copies/pastes everything!

Historical data, how to copy them

I often had to use this method to copy fixings data from one environment to another (Especially inflation data). So here’s how I am copying historical data from one place to another.

What is an historical data file?

Historical data files store the past fixings. Through the GUI, they’re attached to indexes under the name archiving group. One historical data file might contain multiple indices: different currencies (rates), different frequencies (rates), different publication time (FX), etc…

To identify the one that contains the data you need, best is to use DBX Request (search the blog for earlier posts 🙂 ) with a trigger on HBS, You will get something like BXXXXXX_HBS. The XXXX is the historical data file number you need to use, it is unique for each archiving group and if you create the same archiving group in 2 different environments, nothing guarantees that you end up with the same number.

How is the historical data structured?

You have a header and a body. Header file sits as HXXXXXX_H1S (or H2S) and the body is BXXXXXX_HBS. Header determines how is the unique ID for the body assigned: what currency, what frequency. The body has the following info: unique ID, date, rate and effective date (if used). So if you retrieve the unique ID you need (for instance EUR 6M index) from the header, you can then simply retrieve the rows you need from the body (or update them).

How to copy the historical data?

If you understood the above, it becomes then quite simple! Find the historical file you need to copy from and the one you need to copy to. Simply insert the lines from the source into the destination (if you’re copying the whole table, a simple sp_rename on the table does the trick). Once copied, update the unique ID in the body table to match the ID you have in the header. And that’s it.

If you need to do it cross environments, you can use the transfer from RDB to DBF to dump the table onto unix. Copy the file into the destination environment and DBF to RDB to re-upload the table.

There are of course other ways to do it (such as using MDRS) but I tend it to find them more cumbersome and not at all as efficient. This method is fast and easy to repeat. The only downside is that it is hard to completely automate given the uniqueness of the archiving file ID.

If anyone else has a better method (or recommendations), feel more than welcome to share!

How to learn Murex

This is a question I often heard: do Murex provide trainings? Who can teach me Murex or more generally how do I increase my Murex knowledge. So how to learn Murex? Sadly there are not thousand ways and they all involve work!

1- How to learn Murex – Trainings

This one is believed by many to be the silver bullet. Some trainings and the lack of Murex knowledge goes away (would make a nice ad spot). In my opinion, trainings are very limited in the knowledge they bring. They’re great to give a headstart on a completely new domain but they won’t be enough to go into details and built a long lasting knowledge. The other advantage of trainings is that it motivates people showing that you’re investing into them. 2/5

2- How to learn Murex – Workshops

The extension of the first one and the next step. It is much more useful especially when the workshop is done to yield concrete results. The attendees come with a problem/a request to solve and the workshop shows how to attend to it. The number of attendees is then very limited as it must be very hands on. 4/5

3- How to learn Murex – Documentation

So many people asking for documentation! Unfortunately, the documentation is an assistance once you know what you want/need to do. Without that information in the first place, the documentation will just describe what are the different screens without giving you a real opportunity to play with them. 1/5 (this note does not mean that documentation is not useful, quite the contrary. But its objective is not to teach you how to use Murex but how do some functions work).

4- How to learn Murex – Playing with the system

This one depends a bit on people and how much they know how the business works. Playing with the system when you try to do something along with the documentation and/or someone to bounce questions is probably one of the best way to learn about the system. If you’re brand new to Murex or to a module, it gets much harder to learn about it. 3/5 if new, 5/5 if you know what you need to do.

4- How to learn Murex – Production/Project issues

The best way to learn the system. Limited time, pressure to deliver adds to the stress of learning faster and getting results. Ideally, you can combine this with the one above once things calm down or you have a bit more time. The knowledge you gain this way is a mix of Murex and business and will be long lasting. 5/5

 

There is no silver bullet to learn about Murex. There is a learning curve, it is quite steep and you can’t learn about it alone. You need access to the system, you need to know what to do with it otherwise it’s a bit like playing with excel and trying out the different menus. So if you want to learn, get involved in issues, projects and work hard solving these. This will help you on the learning curve and take you to the next level!

 

 

Rate propagation – Curve relationships

When working on Murex rate curves, one quickly faces the problem of curve relationships and what is called as rate propagation. Once understood, it seems very simple. But before you get to that “Eureka” point, it might be confusing. So let’s dig into it and hopefully bring you some “Eureka” moment!

First of all, rate propagation only makes sense when you are working with multiple curves in the same currency. The rate propagation determines how are the other curves going to move when one curve moves. The setting sits under the rates general settings and can take 3 different values:

– Keep market quotes constant (KMQC)
– Keep zero rates constant (KZCC)
– Keep market quotes constant/Impact sensitivities

The first one and the 3rd one have the same results when perturbing one curve but the 3rd one tries to show the sensitivities due to other curves perturbation. Effectively you should hesitate between the second and the third one, as the first one does not show you the right sensitivities.

In the mode KMQC, the rate curves are recalibrated after each perturbation. Let’s take the following example:

USD DISC
USD 3M
USD 6M

USD DISC has no dependency on other curves. It can self calibrate.
USD 3M depends on USD DISC to calibrate its swap pillars as they are estimated on USD 3M but discounted on USD DISC. USD 6M depends on the 2 other curves as it contains basis swaps estimated on both 3M and 6M curves and discounted on DISC curve.

Rate propagation mode : KZCC

In the mode KZCC, you basically assumes that if any rate changes, then the zero rates of the other curves do not change. So if your USD DISC curve changes, then the zero coupon rates of both USD 3M and USD 6M will remain the same. It means that the market rates of the USD 3M and 6M curves will change. Your ZC rate for the curves does not change, so the estimated rates will remain the same. But your discounting rate has changed (USD DISC has changed), so you need to change the fixed leg rate (aka your market quote) or your margin (basis swap market quotes) so that the NPV of the swaps remains 0.

Rate propagation mode : KMQC

In this mode, you assume that the market quotes remain the same when one curve is perturbed. So your ZC rates should be recomputed. Let’s see why! Using the same example as above and perturbing the USD DISC curve will yield the following:
– USD 3M ZC rates will change
– USD 6M ZC rates will change

When you’ve changed your USD DISC curve, the discounting rates will change. So in the case of your IRS in the 3M curve, the discounting rate will change, the fixed leg rate remains constant (Keep Market Quote Constant!), so your fixed leg has a different NPV. As such, you need to modify your estimation rate (USD 3m ZC) to reach a NPV of 0.
Similarly for the 6M curve, the 3M leg will have changed NPV, the 6M leg has different discounting rates, so you need to adjust the 6m estimation rates to keep a NPV of 0, so the 6M zero rates will change.

STOP there. There are more complexities that you can lay on top of these propagation modes but the above will always stay true: you need to maintain a NPV of 0 in every instrument in your curves and that’s the only way to do it.

1 more question:

I can’t reproduce the same behavior with manual shifting, why is it so?

What I wrote above is true and what should happen BUT sometimes the variation in values are actually quite small or 0. For instance, in KZCC, if your USD 3M curve is quite flat, then you won’t see much difference after the change in the discounting rates. Why? All flows fall on the same date for the fixed and floating leg. So you can sum both flows before applying the discount factor. If your estimation curve is flat, then prior to the shift of the discount rate, your sum of the 2 flows was already close to 0. As such, the impact of the discount factor is limited.

Rate relationships have changed a lot in the more recent versions with bugs and enhancements. So if there is something you can’t explain check with someone with more experience or a more recent version if you can.

Questions and comments are more than welcome!

eTradepad – 10 useful tricks

eTradepad is a great tool, it lets you price, build strategies, strip pricings, compare prices and save quotes for later use. The tool is very rich and there are few things to know about it if you want to maximize its usefulness. Here’s my 10 things to know about eTradepad for a better you!

1. Finding a field name in eTradepad

Let’s start with the basics. When writing code, sometimes finding a field name is not obvious. Of course, one could always use the right click-Field-Plain name but you can’t copy it. So I prefer to use formula editor-customize on the field to have the field name and its string directly in the formula editor

2. Comment code

This is very very important: always comment your code. Especially when you put in a workaround or something not obvious. You could think that it will guarantee your job but it will effectively guarantee that you won’t remember your code in couple of months. And that if you go on holidays, people will need to get in touch with you to understand what is happening

3. Macros

You can create macro buttons in eTradepad. You basically attach some code to them and you can then add them at the bottom of your screen. Macros are very useful when the user wants to have some things changed all in one go

4. Workflow refresh

The button to have when doing pretrade workflow. (it sits at the very end of the list of action buttons: wkf: XML refresh). This button refreshes the pretrade code and applies it. So rather than starting a new session every time you need to try out some pretrade, use that button

5. Formula debugger

Hopefully everyone knows about it now but the formula debugger (Help-Monitor-Formula debugger) brings a popup with the executed formula as well as boolean statements and values loaded into variables.

6. Viewer

You can turn your etradepad into a viewer. The look would be like a pricing matrix. For example option maturity on the top, swap maturity on the left and premiums as the output. The development is relatively recent and can be triggered from the external settings of the notepad you’re in.

7. SCF … Don’t

SCFs are a no go in eTradepad. If you do need to use them, test, test, test and re-test. They are not all supposed to be used in the context of eTradepad. Choose an additional flow or any other solution instead of using them

8. Text area

With Mxpress, Murex did a great job at educating people to use the text area. It can give a nice text description of the payoff that the user is currently pricing. It can also be copied into the clipboard if the info needs to be sent to customers

9. Archiving

When awaiting for a customer answer or to share a pricing, Archiving is a great tool. It lets you save a pricing (either privately or publicly) so you can re-use it for later. It is much lighter than saving a dedicated notepad for each pricing you want to keep. In terms of maintenance, it is much easier to clean old archives as opposed to old notepads

10. Excel paste special

Really love this function. If you’ve got a correctly formatted excel (and preferably a notepad with horizontal display), you can paste from Excel into Murex creating new entries (aka new pricings). For that you need the action Paste Special and choose to create new lines. Very useful if sometimes you need to price a set of trades external to Murex.

What about you dear reader? Was this useful to you? Any other tricks to give away?