LSE dumps Windows? NYSE dumped by SDBK

July 3rd, 2009 / Tales from a Trading Desk

If Microsoft has lost its Windows/.NET foot hold in the LSE and it was related to issues in old versions of SQL Server/Windows, it may at least say some face by disclosing the issues and validating that they are fixed in news version of its database/OS. Speculation alone could damage Microsoft in the capital markets world.

On the flip side, it looks like today wasn’t a good day for the NYSE. Microsoft doesn’t appear to be blamed for the NYSE issues. NYSE SDBK is a server-based system based on NYSE Arca – the SuperDOT replacement. Anyone know what NYSE SDBK was written in? Java on Linux?

JSON, XAML, PowerBoots and PowerShell

July 3rd, 2009 / Development in a Blink

Miguel de Icaza, head of Mono, tweeted:

migueldeicazaIn 2007 @toshok used JSON instead of XML for XAML. It is wrist friendly, and programmer friendly:http://bit.ly/2fjEpN

The post, titled, why xaml when you can json? shows this snippet and has createFromJSON code.

JSON and XAML

var json = {
  Canvas: {
    name: "Toplevel Canvas",    children: {
      TextBlock: {
        Text: "Hello World"
      }
    }
  }
}

and it converts that to the following xaml:

<Canvas xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” x:Name=”Toplevel Canvas”><TextBlock Text=”Hello World”/></Canvas>

PowerBoots and PowerShell

image

PowerShell, PowerBoots and an Oslo DSL Grammar

July 1st, 2009 / Development in a Blink

David Langworthy, the Microsoft architect who owns The “Oslo” Modeling Language Specification, has these “Modeling in Text” videos HERE that walk through the specific process of creating a domain-specific language.

Intellipad

image

Working from his example we’ll compile grammar and transform the DSL into Xaml using PowerShell to read and create PS Custom Objects.

  • I ‘embedded’ the DSL (lines 1-6)
  • The DSL Grammar (lines 9-26)
  • Called the M tool chain
    • line 28 the M Compiler
    • line 29 the MGrammar Executor

Then

  • Read the Xaml file produced
    • Converted it to an XmlDocument, line 31
    • Looped through the entities in the graph
  • And generated PowerShell Custom Objects

Finally

From DSL => DynamicParser => Custom Objects => WPF data bound control

image

Using the M tool chain in this ways has it’s advantages in several scenarios. This script can easily be streamlined by checking file dates and bypass the m and mgx steps.

In future posts we’ll see if we can interact with the MGrammar namespace and work with Oslo in a deeper way.

Innovation Vs Cost-Containment

July 1st, 2009 / newyorkscot

Luke met with the good folks at Advanced Trading at SIFMA the other week, the result of which was this article “SIFMA: Cost Cutting, A Double-Edged Sword?” that outlined his observation on the maturity of the purchasing decisions investment banks make (or don’t make!) in hiring consultants: 

Level 1: Lowest dollar cost – is it really the cheapest option if it takes twice as long ?

Level 2: Total Cost of Project – factor time to completion, debugging, compliance, etc

Level 3: Risk-adjusted cost perspective – probability of success for the investment

Level 4: Innovation – the need to bring new ideas to the table

Needless to say, there is indeed a tight correlation between these levels and the timeliness/quality of the final product….

NASDAQ OMX Market Replay Europe goes Adobe AIR

July 1st, 2009 / Tales from a Trading Desk

NASDAQ OMX Market Replay Europe provides users with instant access to historical quote and trade data from major European exchanges. Filter by exchange for a more targeted view of the market. Analyze execution quality and monitor MIFID compliance within minutes of trade execution.

Video here, or sign up for a free account and install (AIR and Administrator access required) the RIA – 2nd February 2009 data only available on the free trial.

MSDN Magazine – July 2009 Articles Worth Reading and Stuff

July 1st, 2009 / Tales from a Trading Desk

Here’s my pick of the articles to read:

  • Securing The .NET Service Bus
  • Composite Web Apps With Prism
  • Distributed Caching On The Path To Scalability
  • Request-Response Testing With F#
  • Building Tuple
  • Usability Testing

Other postings worth reading in blog land:

Catching Up – Lab49 Articles

July 1st, 2009 / newyorkscot

Life at Lab49 has been busy recently with a diverse set of client delivery, sales and marketing activities – all good news as the business continues to grow on both sides of the Atlantic.

On the marketing front, we have written a lot of great articles this year, and have been in a number of other features, providing commentary to the relevant stories. They can all be read on the Lab49 website here with the articles carved out in a separate page here. A few highlights:

Waters Special Report: IT in Crisis: Lab49 sponsored a special report in the SIFMA edition of the magazine, the theme of which how financial institutions should be addressing the current challenges presented by the financial crisis, and how, by investing in the right technology, firms can radically improve their agility and intelligence.

Robust, Reusable Drag-and-Drop Behavior in Silverlight discusses how developers can can greatly increase the overall robustness and re-usability of any drag-and-drop implementation in Silverlight, through the manipulation of an element’s RenderTransform with attached behaviors.

Riding the Tsunami discusses why firms need to update their trading and risk infrastructures and implement a holistic approach with a balance of powerful new technologies. 

Building a bank from scratch hypothesizes what it would take to rebuild bank systems from scratch to support real-time data aggregation and analysis, to provide a platform to capitalize on next-generation technologies, and to accommodate constant change. The article also outlines what principles, technologies and processes should be put in place to facilitate the optimal solution.

Concurrency: Take Control or Fail discusses how new trends in hardware demand the adoption of parallel programming throughout the financial enterprise, and why firms need to start getting up to speed now, or risk falling behind.

Trends in FX

July 1st, 2009 / newyorkscot

The 2009 edition of FXAll’sBest Practice in Foreign Exchange Markets” has some great commentary on what has happened to the FX market in last 9 months: reduced volumes, increased volatility, return to high-touch client relationships, and the lack of liquidity in the forward market (see Page 12). Key point: forward trades (swaps,outrights) are essentially loans and hence need to be modeled/priced as such (think: counterparty/settlement risk from a credit perspective).

Design time support for Prism.

July 1st, 2009 / Learning in progress

As we all know that Designer-Developer workflow is not feasible when the application is developed in Prism (Composite Application Guidance). Prism requires each use  case to have it’s functionality in different modules and load these modules at run-time.

Due to runtime loading of the user control neither Visual Studio or Blend can be used for implementing designer-developer workflow as the user interface cannot be seen in its entirety.

Here is what i implemented with the help of Marc Jacobs . We create an attached behavior that can be set on any ContentControl or ItemsControl. This attached behavior takes the user control which we need to display while design-time.

OnContentChanged

The magic happens in the OnContentChanged method, when we set the attached behavior content this method is invoked. The code inside the method only inserts the user control in the design mode.

ShellXaml

The only downside of using this technique is having the user controls declared in the resource dictionary. Also below are the snapshots  of the application in design and runtime mode.

Design time snapshot Runtime snapshot
DesignTime RunTime

Code DesignTimePrism.zip

CEP within FX

June 30th, 2009 / Tales from a Trading Desk

e-Forex has an article on CEP and FX: while trading and trade-related projects like smart order routing (SOR) accounted for 48% of existing use cases, areas like risk management and market data were making “double-digit headway”.

“While the initial usage of CEP technology was in equities trading and algorithms, it has since moved out into other asset classes. The need for CEP – be it in FX or other asset classes – is driven in areas where there is high throughput, low latency and a need for faster decisions. Traction is certainly building in FX, especially compared to recent for tunes of the equities market.”

StreamBase Adds Twitter Algo Trading

June 30th, 2009 / Tales from a Trading Desk

A new twist on machine-readable feeds. Has StreamBase found a new opportunity to weld social networks and trading? Something for Microsoft to consider with Orinoco.

Matrix and Bloomberg

June 30th, 2009 / Tales from a Trading Desk

Bloomberg_Matrix

Incubator @ Coherence SIG, New York

June 29th, 2009 / Gotham Canuk

The last Coherence SIG at Oracle’s office in midtown had three topics — the last of which was an update on the Coherence Incubator. If you’re new to Coherence, the Incubator is home to a library of frequently used design patterns for Coherence clusters as well as experimental functionality which may or may not enter the product.

 

All design patterns depend on the Commons project which holds common implementation code. The Command Pattern is the most fundamental of these patterns, and the foundation on which all others are built. Its main idea is that instead of using Coherence’s synchronous EntryProcessors, commands can be run asynchronously using this design.

From what I understood, the latest incubator developments were in the Push Replication pattern which allows for data to be published to remote devices, including other Coherence clusters. The published data can be batched and even filtered such that only data of your choosing is replicated.

To get more details and to see what’s cooking in the labs, here’s where to get started.

Create a Domain Specific Vocabulary in PowerShell for Measuring Portfolio Returns – Part 1

June 29th, 2009 / Development in a Blink

DSLs and DSVs (Domain Specific Languages and Vocabularies) can be super helpful and are not complicated to build.

Example

The mean return to a portfolio is the weighted average return of the stocks making up the portfolio.

Let’s say a portfolio consists of 30% GOOG shares with a mean daily return of 0.14% and 70% MSFT shares, mean daily return of 0.03%.

The mean daily return is:

(0.3 * .14) + (0.7 * 0.03) = 0.063

Another portfolio of 50% GOOG and 50% MSFT gives

(0.5 * .14) + (0.5 * 0.03) = 0.085

The PowerShell DSV

I’d like to represent the portfolio like the following, legal PowerShell syntax.

Portfolio 'Tech Companies' {  New-Stock GOOG .3  New-Stock MSFT .7}

Portfolio 'Tech Companies Balanced' {  New-Stock GOOG .5  New-Stock MSFT .5}
 

Let’s build up the Domain Specific Vocabulary

Lines 1-3 enable the DSV to work and prints:

Tech Companies Tech Companies Balanced

       

   1: Function Portfolio ($portFolioName, [scriptBlock] $sb) {

   2:     $portFolioName

   3: }

   4:  

   5: Portfolio 'Tech Companies' {  

   6:     New-Stock GOOG .3  

   7:     New-Stock MSFT .7

   8: }

   9:  

  10: Portfolio 'Tech Companies Balanced' {  

  11:     New-Stock GOOG .5  

  12:     New-Stock MSFT .5

  13: }

 

Adding lines 4-8 will output the snippet below. Note line 7 uses “&”, the PowerShell call operator, to evaluate the script block.

Tech Companies     GOOG .3     MSFT .7 Tech Companies Balanced     GOOG .5     MSFT .5

   1: Function Portfolio ($portFolioName, [scriptBlock] $sb) {

   2:     $portFolioName

   3:     

   4:     Function New-Stock ($stockName, $percentage) {

   5:         "`t$stockName $percentage"

   6:     }

   7:     

   8:     & $sb

   9: }

 

Transform the Data into objects

Let’s transform the data into objects with properties so it prints the following table, with the added plus of addressable properties.

PortFolioName           Stock Percentage-------------           ----- ----------Tech Companies          GOOG          .3Tech Companies          MSFT          .7Tech Companies Balanced GOOG          .5Tech Companies Balanced MSFT          .5
 
   1: Function Portfolio ($portFolioName, [scriptBlock] $sb) {   

   2:     Function New-Stock ($stockName, $percentage) {

   3:         New-Object PSObject | Select @{

   4:             Name = "PortFolioName"

   5:             Expression = {$portFolioName}

   6:         }, @{

   7:             Name = "Stock"

   8:             Expression = {$stockName}

   9:         }, @{

  10:             Name = "Percentage"

  11:             Expression = {$percentage}

  12:         }

  13:     }

  14:     

  15:     & $sb

  16: }

 

Calculate the Weighted Average

Adding a hash table lookup in lines 4-7 and the properties MeanDailyReturn and WeightedAverage in lines 18-24.

Lines 20 and 23 look up the MeanDailyReturn by stock name using dot notation.

PortFolioName           Stock Percentage MeanDailyReturn WeightedAverage-------------           ----- ---------- --------------- ---------------Tech Companies          GOOG          .3            0.14           0.042Tech Companies          MSFT          .7            0.03           0.021Tech Companies Balanced GOOG          .5            0.14            0.07Tech Companies Balanced MSFT          .5            0.03           0.015

   1: Function Portfolio ($portFolioName, [scriptBlock] $sb) {   

   2:     

   3:     Function New-Stock ($stockName, $percentage) {

   4:         $MeanDailyReturn = @{

   5:             GOOG = .14

   6:             MSFT = .03

   7:         }

   8:     

   9:         New-Object PSObject | Select @{

  10:             Name = "PortFolioName"

  11:             Expression = {$portFolioName}

  12:         }, @{

  13:             Name = "Stock"

  14:             Expression = {$stockName}

  15:         }, @{

  16:             Name = "Percentage"

  17:             Expression = {$percentage}

  18:         }, @{

  19:             Name = "MeanDailyReturn"

  20:             Expression = {$MeanDailyReturn.$stockName}

  21:         }, @{

  22:             Name = "WeightedAverage"

  23:             Expression = {$MeanDailyReturn.$stockName * $percentage}

  24:         }

  25:     }

  26:     

  27:     & $sb

  28: }

 

In an upcoming post

The transformation of the DSV into objects and properties is finished. In an upcoming post we’ll add some more detail and play with the output.

Building Low Latency Applications for Financial Markets

June 29th, 2009 / Tales from a Trading Desk

White paper available here

SIFMA 2009 – Siverlight and WPF

June 29th, 2009 / Tales from a Trading Desk

Marc offers a view of SIFMA 2009 – unfortunately being on the wrong side of the pond doesn’t allow me the luxury of attending. I suspect however that Kaazing have something to shout about given that Kaazing Enterprise Gateway was part of the solution that won the Innovator Award from Windows in Financial Services for Silverlight Integration. Shame Kaazing don’t have the demo running on their web site – missing a trick?

Looks like Lab49 picked up an aware for a risk WPF application as well.

Buying Off The Shelf: The Game

June 29th, 2009 / Tales from a Trading Desk

There are many flavours of build/buy in the typical capital markets sell-side trading application. Some banks such as Goldman appear to enjoy building their own database, language and then the trading applications on top of their home grown infrastructure. Other sell-side companies are happy to buy off the shelf infrastructure, building only the trading application itself using standard development languages. In general there appears to be a general trend that US investment banks appear to prefer to build rather than buy, where as the European banks are the reverse – my view ) .

The banks that prefer to build present a challenge for any product company. Product companies normally charge hefty licence fees per CPU, and expect to make a good margin on all sales. In the case of these “builder” sell-side corporations, the first challenge is getting your product to a Proof Of Concept (POC) stage. Post the POC it’s all really down to cost – especially in the current credit-crunch climate. A product company can have the best “solution” in the world, but if the cost isn’t right you could find the door well and truly closed – possible for a number of years until the next POC appears. Product companies need to take a step back and understand that if you can sell your product to a successful project then this is more than likely the best advertising you’ll get within the bank, which will generate future licensing fees coupled with the likely hood that other projects will leverage the successful architecture and knowledge from the initial project thereby generating new licensing revenue for the product company.

Unfortunately, if the product company doesn’t “get” the above they’ll fail post POC with a degree of negative exposure that will probably be well documented on some wiki within the organisation thereby ensuring that the sell-side doesn’t POC again for 2-3years. You can also guarantee that any future POC for product vNext will have to initially overcome the original purchase blocking issue.

In summary, product companies need to understand the impact of their action.

Graphical environments are designed to help novices -PowerShell Automates

June 28th, 2009 / Development in a Blink

Neal Ford, in his book “The Productive Programmer”, says

The very things that make casual users more productive can hamper power users

He adds

You can get more done at the command line for most development chores than you can through a graphical interface

He was on a project that required opening and updating several spreadsheets on a regular basis. He took a few minutes and wrote a Ruby script to do it.

Even though it didn’t take long to open the files by hand, the little time it took was still a waste of time, so I automated it

The PowerShell Version

Open-XLWB

 
image

DailyLogs

 
image

Result

image

image

For ISE

In the PowerShell Integrated Scripting environment you can launch DailyLogs from the command pane.

Note

Software development has lots of obvious automation targets: builds, continuous integration and documentation. There are less obvious but no less valuable ways to automate development chores

PowerShell is an automation platform, automation platform, automation platform (quote from Jeffrey Snover). Let the automating begin.

Downloads

Place the two scripts in a folder that is in your path.

Book: Applying Domain-Driven Design and Patterns

June 28th, 2009 / Tales from a Trading Desk

I haven’t read Eric Evan’s DDD book yet, so I suppose in some way I started back to front in the order in which both these DDD books should have been read. Jimmy’s book was a slightly different read from the books I have read of the last few months – the book kind of reads in a paired programming style.

Fluent interfaces (page 176) is just an example of how Jimmy manages to cover so many important patterns in a 500 page book. Linq offers a good example of a fluent interface.

It’s rare to come across a financial pricing sample in a .NET book, but page 369 delivers thanks to Erik Dornenburg – one of Jimmy’s friends who have contributed to the latter part of the book.

Agile and UX Married

June 28th, 2009 / Tales from a Trading Desk

This presentation provides some insight into the marrying of Agile and UX – slide 8 in particular. Overall if you are attempting to use a lean agile UX process I believe you need to run UX one iteration ahead of the development iteration, and ensure there is adequate coverage during the development by the UX architect/designer to assist where appropriate. Power to the user journeys )