ITQuants blog

Author: Created: 2/17/2012 1:03 PM RssIcon
My personal blog on ITQuants
By Philippe Bonneau on 9/29/2014 2:05 PM

Using the Sophis toolkit, it is easy to save user data by filling the parameter columnName in the CSRElement constructor and the ones of its derivated classes. When overriding the CSRInstrumentDialog class, the data will be then stored in a field of the Sophis native Oracle table TITRES, on which you have to add the expected field. Prefixing the field to remember that the field was created by the client is the common rule used. For other user data on which an entire Oracle table needs to be created, it is safe to override the CSRFitDialog::Save method too. Now, if you have to store other data even when having no GUI open, when using batches for example, the best is to add an implementation of the CSRInstrumentAction class, and to save data on the callback NotifyCreated and NotifyModified. All these things are basic concepts explained in the Sophis documentation. There are some cases on which we need to save data after the Oracle commit. This post will explain how to implement it.

By Philippe Bonneau on 9/26/2014 4:58 PM

In my precedent articles that I've published concerning the memory leaks (C++ memory leak check on x64 platform and test of different tools and How to filter Intel XE Inspector results), I was talking about the fact that for huge programs like Sophis Risque, the debugging using such tools is quite difficult to do. In fact, in some cases, I've found no tool that can do the job as I wanted. Using a tool like Intel Inspector gives sometimes so many errors that it is quite difficult to detect the real problem. That's why I've developped one tool that permits to detect easy bugs without impacting the whole performance during all the test but just for a piece of code that could interest me. The goal of this post is to present this tool.

By Philippe Bonneau on 9/15/2014 5:07 PM

I was asked recently if I knew how to change the color of the titlebar on Sophis Risque in order to catch the user attention. At first, I've made a wrong answer: "Easy, you just need to paint on the WM_NCPAINT as Sophis Risque does it when the simulation mode is selected (and as I've developed it on the v4)" !! ...

Unfortunately, this mode does not work anymore as it was developed for Window 95/2000.... A lot of articles can be found on the Net (like codeproject or codeguru), but no one gives the code to run it with the themes that were developed on XP, or on Vista/7 when the Desktop Window Manager service is started. For example, when the Windows Desktop Manager is disabled, as best effort, and using the MS SDK functions ::DrawCaption and ::DrawFrameControl, the dialog will look like this one:

Note that the minimize, maximize and close buttons do not have the new style as expected.

The goal of this post is to describe how to do it.

By Philippe Bonneau on 7/29/2014 5:04 PM

One client, a fund asset manager, asked me recently if I didn't have any tool that permits to make non-regression tests or performance tests when migrating from a version of Risque or Value to another one.

The goal of this post is to provide such a tool, when doing non-regression performance tests. This is based on the fact that the SEC server linked to the Oracle server is the bottleneck of the Sophis architecture.

When each Sophis Risque/Value client receives a notification, in most cases on versions <5.2 and in some cases after on Sophis internal messages, it does a query on the Oracle server. On user events, it depends how it was developed.

By Philippe Bonneau on 7/16/2014 11:28 PM

I've decided to restore some posts that were published on the previous it-quants.com website. These posts are old and published between 2007 and 2008, but are still interesting. One of the most interesting post described how to build a IIS webservice in order to export some functions that can be used by Talend, which is now a well-known French ETL tool.

By Philippe Bonneau on 7/10/2014 8:47 AM

Some functions of the Sophis toolkit API are exported and stored in this dll. It contains at least the classes that permit to add contextual menus to the portfolio view, overloading the CFD deal input dialog, the portfolio headers (which correspond to the dialog in which the main sensitivities of the folio are displayed) and payment methods.

By the way, this dll implements some functionalities for the .Net toolkit, it means that it is linked to the MS C# .Net framework, loading other assemblies when it is loaded by dlls or executables linked to SphPortfolioGUI.lib.

I have the case where most of the dialog overloadings and Sophis toolkit calls are stored in one toolkit dll. Unfortunately, this dll exports a lot of functionalities that were used by night batches. It means that the night batches load the dll twice:

  • one using the static link, when MS starts the process
  • the second one, by the Sophis API, since it is declared as a toolkit/plugin dll and loaded dynamically when the CSRApi::Initialise method is called.

I wanted to add contextual menus to the porfolioview. It causes no problem when the toolkit dll is loaded by Sophis Risque, but does not work when night batches are launched, since it tries to load assemblies without initialilzing the .Net security as SphRisque does it (creating specific AppDomain for example). I got an access violation as below:

I will explain in this post how to resolve this problem.

By Philippe Bonneau on 7/8/2014 11:07 AM

In one of my previous posts that can be found there: http://www.it-quants.com/Blogs/tabid/83/EntryId/39/Sophis-Risque-how-to-manage-limit-memory-allocation.aspx, I've detailed a method that works fine on the following OS: Windows XP and Windows 8, with or without Citrix, using the MS CreateJobObject method. 

Unfortunately, Microsoft has changed the behaviour of the jobs on Windows 7, and limit the creation to one job on this OS. Citrix is using already one job to control the limitations that can be driven through their configuration manager. For example, we will consider the case where the memory consumption is configured per Sophis user. The goal of this post is to explain the solution that could be retained, without exporting the rights to the Citrix configuration and let keeping Risque/Value manage the memory consumption as before.

By Philippe Bonneau on 5/29/2014 10:31 PM

In some circumtances, it is interesting to get the list of columns which are currently used in the different portfolio configurations. Getting such a list permits to see which toolkit columns are really used. Missing columns can be removed from the toolkit dlls.

The configuration of portfolio columns are stored in a BLOB field of the Oracle table USER_SETTINGS. We just need to use an XPATH query to get the list.
By Philippe Bonneau on 5/21/2014 11:06 PM

For remember, on SQL databases, triggers permit to change the behaviour of insertions, modifications or deletions made by a program, by adding SQL notification callbacks. This permits to make complex check on field values, or to copy some record in audit tables for example.

On Oracle, a trigger can be implemented after or before the action. On before triggers, values can be changed by the notification callback. On after, we are sure that any modification done by the program or on before triggers is taken into account in the :new record.

 Sometimes, complex check should be made on several tables, during a transactional modification for example. In such a case, a BEFORE COMMIT trigger is mainly required. Even if it is more recommanded to do such a check in the client program, on third party databases, there is no choice, additional checks can be done only on the database server. Unfortunately, Oracle does not permit such a trigger implementation directly, a workaround has to be developped. This is the purpose of this post.

By Philippe Bonneau on 5/15/2014 4:39 PM

Using Sophis Risque 5.3.7 and equivalent Value version or less, negotiation date of the deals done by the trader are stored into database using the local time zone of the machine on which Sophis Risque is launched. Unfortunately, on multisites/multi countries architecture, the timezone is not stored into the database, raising an issue on the last requirements for compliance and regulatory checks. The goal of this post is to explain how to add the required timezone.

Search blog