This week's book giveaways are in the Angular and TypeScript and Web Services forums.
We're giving away four copies each of Programming with Types and The Design of Web APIs and have the authors on-line!
See this thread and this one for details.
Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Learning about financial trading system

 
Ranch Hand
Posts: 584
6
jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I would like to learn more about financial trading system (stock trading). I work on an java based equities trading platform but I only know the technical aspect of the service that I manage.

I would like to understand the overall architecture of trading systems and business usecase of each component. I also want to learn more about trader acronyms like long and short positions, hedging, ETF, RFQ etc.

I searched in google but all I find were things for actual traders, was unable to find something from developers perspective.

Please advice on where I can find resources for these.

Please move this thread to appropriate forum in case this is not the right platform, I was not sure which section this should belong to.
 
Saloon Keeper
Posts: 21437
143
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're talking about a very complex world.

At its heart, every trading system is about - well, trading. Someone has something to sell and someone wants to buy it.

To make it easier for buyers and sellers to find each other, one or both must either advertise their interest or a third party must provide somewhere where they can find each other. That "somewhere else" is known as an exchange. Exchanges may in fact buy, hold and/or sell directly as well - including with other exchanges, but their primary appeal is that independent parties may participate as well. The exchanges generally make themselves profitable by charging a fee on transactions.

What can you buy or sell? Well, just about anything that can legally be bought or sold. A given exchange may only deal with one commodity type or at most a few (such as agricultural options), but there are lots of different types of exchanges. Exchanges also typically publish trading information as an aid to buyers and sellers. That includes number of lots (for example stock shares) and trade price.

Among the oldest type of financial instruments traded are stocks and bonds. But anything you can reduce to a paper representation is fair game, including future prices for agricultural harvests (pork bellies, orange juice, grains and so forth), metals and mine production, mortgages and it goes on and on.

And in addition to individual instruments, you have compound and derivative instruments. I can unfortunately take a lot of blame for the Great Recession of 2008. In the late 1990's I worked in a division of a company whose sole business (the division, not the company) was to value other companies' mortgage portfolios. Basically, what we produced was a set of predictions on batches of mortgages (called tranches) as to the rate at which they would be paid off (including by early payments), the likely rate of defaults and thus their present and expected future values and the amount of income (in the form of mortgage payments) that they would produce.

Once we calculated those values, the mortgage-holding institutions knew something. A mortgage starts with a lending institution such as a band or credit union. Once the bank (or whatever) knew what their mortgages were/would be worth, they could do things like sell tranches to another institution. And in fact, could split up the payment collection rights and actual ownership of those tranches and sell them separately. When my house was built, the lender promised that my mortgage wouldn't be re-sold. They lied. It was. Then, thanks to having bought shares of Cisco stock back when the Internet was new, I made enough profit selling them off to pay off that mortgage early, as an example of how a tranche can suffer attrition over time.

Where the real trouble began for the rest of the world was that whenever you have something to buy or sell, someone will construct an abstraction that can in turn be bought and sold. And often, abstractions and trading funds then arise on them. Such was the case for the mortgage portfolios we valued. First and foremost, since the present and future values of mortgage portfolios is often a large part of the assets of a bank, the banks used our valuations as part of the wave of mergers and acquisitions that flooded the financial industries back in the 1990s and early 2000's. Creating the banks which were "too big to fail". For a while, we ended each year with about half as many customers as we started with, because our data was used by one customer to buy another customer (and by that customer to know how much they should sell themselves for).

But that was just the beginning of the evil, even though that particular problem still exists. The greater evil was when people started writing "loans" using those tranches as collateral. That is, Mortgage-backed Securities. MBS's were supposed to be reliable income sources based on the expected income from their underlying mortgages. But note the fatal word there: expected. What happened was that a recession started and it was worse than expected, causing massive long-term layoffs. This caused the default rates on mortages to skyrocket, invalidating the original portfolio valuations. In the case of MBS's, the effect amplified itself, destroying their value. Which caused bank failures and general turmoil in the larger financial markets. And, in the process, wrecking many ordinary people's retirement plans, causing long-term layoffs and other damage that persists to this day. It's generally considered that many people today will never see their full lifetime income potential because of it. Or even recover at all.

And this, mind you, is just what you can do with mortgages. I haven't even mentioned tradeable fund shares, non-mortgage derivatives or any of the other creative ways that people find to make themselves rich without actually producing any sort of tangible product.

Going back to the basics, though, almost all trading is based on what you think something is worth. In the case of financial instruments, that "worth" is both what it sells for right now and what it could sell for in the future and on what, if any income (such as dividends and/or interest) the commodity in question will accrue along the way. And what the probability (risk) of that commodity has of failing to meet those expectations. Up to and including total loss.

Also, some instruments have a lifespan. Options are the most notable example. I can purchase an option to buy 1000 shares of XYZ Corp at a price of $25.00 a share at any time within the next 3 months. How much that option costs me is going to be priced based on the current value of XYZ shares and the expected probability that it will rise in price enough to make the option valuable before the 3-month time limit expires. Options come in both buy and sell flavors (calls and puts), can be covered or "naked" (short-selling) and be "in the money", "at the money" or "out of the money" and all that can easily make a full chapter on any book on financial trading.

From a software point of view, then, what is expected is ways to rapidly and accurately predict trading opportunities and to alert or place trades to exploit those opportunities. Which, while pretty typical in their overall shape, are in practice usually tweaked in proprietary ways by the firms employing them. In addition to specialized algorithms (such as the mortgage portfolio valuation system I worked with), you may see carefully-trained Artificial Intelligence systems at work. So most trading systems are full of trade secrets that you're not going to find in books or on the Internet.
 
s ravi chandran
Ranch Hand
Posts: 584
6
jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the detailed explanation. Very informative. The type of commodities that can be traded is so vast I often loose track of it.

If we exclude proprietary aspects of a trading platform, there should be a generic architecture flow for all these systems, would that be correct assumption ?

For example, for any type of commodity to be traded, I can think of these many components needed in a basic trading system:


I think there would be some more components that would be required like risk evaluations, post trade feeds, trade report generators and some form of profit/loss stats for traders to know their overall position.

We would also have systems specific to commodity types.

Does this architecture seem reasonable ? With limited know how I have, I can think of these many components.
 
Tim Holloway
Saloon Keeper
Posts: 21437
143
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's as good as any. What the exact toolset would be is going to vary depending on the industry and the trading group.

I would reserve a spot for decision support systems, though. Like so many other professions, trading may eventually become completely automated. Machines can weigh more factors more dispassionately and make judgements much faster and the final result is probably going to be the Ballad of John Henry all over again.

Although personally, I'm rooting for AI CEOs. They won't demand to be paid more for failures than any 20 employees would earn in a lifetime's hard work, won't jerk the company around for reasons of personal pique, and won't get caught in scandals.
 
s ravi chandran
Ranch Hand
Posts: 584
6
jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed. Automated algo trading is expanding at rapid rate..

AI CEOs would be a novel idea.
 
Always! Wait. Never. Shut up. Look at this tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!