• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Learning about financial trading system

 
Ranch Hand
Posts: 595
6
jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28713
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 595
6
jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28713
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 595
6
jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agreed. Automated algo trading is expanding at rapid rate..

AI CEOs would be a novel idea.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see it’s been a while since this was posted, but I’ve been diving into trading systems myself and was wondering—has anyone explored using open-source frameworks like QuickFIX/J or using modern tools like Kafka for handling trade events? Curious what others found most helpful for learning how real-time systems deal with latency and reliability. Would love to hear about hands-on projects or courses that helped build those skills.
 
Tim Holloway
Saloon Keeper
Posts: 28713
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Risa!

You're not likely to become wealthy using high-speed trading systems as an individual. This is something done by large organizations moving thousands of shares per trade, where fractions of a cent in share price can mean millions of dollars in potential gain. One of their favorite tricks is to be physically close to the trading floors so that the speed of light over telecommunications lines doesn't factor in as much.

For individuals, Warren Buffet's recommendation is to forget about getting rich quick and focus on steady growth, instead. Day traders tend to lose more than they gain.

For example, I bought Red Hat shortly after they went public. I couldn't have bought at the IPO, regardless, but I didn't do the Wall Street comedy-style trading, either. I let the initial excite4ment die down, bought shares, and held them. And held them. All the way until IBM finally bought them out and handed me a chunk of case worth at least 1500x what I'd paid for it 20 years earlier. I didn't try to time the market. I did likewise for several other companies which grew exceptionally well.

I keep a diverse portfolio. Which is good, since I once owned 1000 shares of Air Florida among other companies which went bust while Red Hat was rising.

Another popular strategy is indexing, where you simply buy a fixed dollar amount of shares periodically. So when the stock is down, you get bargains, and when it's up, the bargains help even out the total cost.

Some people believe in Technical Analysis, although expecting share performance to depend strictly on past price performance patterns feels like astrology to me. I prefer to look at the company itself. Can't read financial statements worth squat, but if I read that Tesla is unpopular all over Europe, then I know it's time to sell. Likewise, Micron is likely to benefit from the current political climate because they're based in Utah and have plants in the USA with more under construction, so tariffs aren't going to hurt them as much relative to overseas electronics suppliers.

Now, of course, if you are into day-trading, the current climate is optimal. Day-trading works best when applied to volatile stocks and when considering the Tariff of the Day. that means a lot of stuff is moving rapidly and often. On the other hand, since it's all mood-driven, unless you have millions of dollars of crypto and get invited to private dinners with Trump, you'll just have to guess which stocks will flip which way on any given day.

So, as you may have deduced, I don't use computer aids for making trading decisions for the most part. I'm more about companies than segments, and of course, being a techie, I tend to be most likely to predict trends in the tech industry and be able to invest accordingly.

On the other hand, if I was inclined to be more of an active trader, my own choice would be to train my own AI and use that.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic