Showing posts with label Education. Show all posts
Showing posts with label Education. Show all posts

Saturday, 26 September 2015

High Frequency Trading - A Picture of the Industry

Introduction to High-Frequency Trading:


High-Frequency Trading (HFT) is essentially trading that takes place on incredibly small time-scales involving algorithms that place orders into the market to take advantage of small price discrepancies between assets between exchanges.


In order to put the speed that trading takes place into context we have to begin with a breakdown of the "second" (our base unit of time):

FractionThe Number of SecondsPrefixSymbol




unit1
tenth0.1decid
hundredth0.01centic
thousandth0.001millim
millionth0.000 001microµ
billionth0.000 000 001nanon
trillionth0.000 000 000 001picop


Generally, HFT deals with four fractional units of the second: seconds, milliseconds, microseconds, and nanoseconds.


Contextually, blinking takes around 300 milliseconds, but to further put these units of time in perspective, let's pretend that we want to trade between the Chicago Mercantile Exchange (CME) and the New York Stock Exchange (NYSE) - although the "trading" actually takes place in data centers in New Jersey, not New York:


The time it takes for a signal to travel down the fiberoptic cable from Chicago to New Jersey and back currently takes around 12.5 milliseconds - 4.1% of the time it takes you to blink.


In the early days of HFT it used to take twice as long to do this, but new fiberoptic cable networks in combination with firms who dedicate themselves to HFT infrastructure has dramatically sped-up this process.



Statistics:



  • In 2012, according to a study by the TABB Group, HFT accounted for more than 60 percent of all futures market volume in 2012 on U.S. exchanges.
  • In the United States in 2009, high-frequency trading firms represented 2% of the approximately 20,000 firms operating today, but accounted for 73% of all equity orders volume.
  • The Bank of England estimates similar percentages for the 2010 US market share, also suggesting that in Europe HFT accounts for about 40% of equity orders volume and for Asia about 5-10%, with potential for rapid growth.





The Role of High-Frequency Trading:


Like any trading strategy, the ultimate purpose of HFT is to make money. This process however can be loosely split down into two categories:


  1. Market making and liquidity provision.
  2. Proprietary trading strategies.


Market Making and Liquidity Provision:


When there's an industry wide hiccup and people question the purpose of HFT, the industry responds with this as their go-to argument for their relevance. Without branching off on a huge tangent, market making is the process of creating an environment where trades can be facilitated in the exchange. 


This process is called "Liquidity Provision"  you are making a liquid market where trading is easy for investors. 


e.g. If I want to buy 50,000 shares in Tesco, I need to get them from somewhere (they don't just appear in the exchange), so market makers will create an order book with prices at which they will buy Tesco shares and prices at which they'll sell Tesco shares. Thus allowing me to trade Tesco shares.



Now would be a good time to add that "trading volume" and "liquidity provision" are not the same thing. From an ethical perspective, I feel that if the HFT form of trading is meant to truly provide liquidity in the primary sense of the word (market making is synonymous known as primary trading), then there ought to be a level of market risk undertaken by the market maker/HFT firm. Market makers traditionally lose out on between 50-70% of the deals they make with clients, but will sacrifice these losses to take advantage of the order-flow they can see as a result on the proprietary side of their bank - if you undertake no risk as a result of having system advantages then there is clearly sign that the market is not fairly pricing deals at the exchange.


It's worth noting before I go on that stock exchanges may pay, or charge people to trade at the exchange. HTF firms will therefore usually opt for exchanges where a liquidity rebate is provided for market makers - where they get pad to make markets there.


It's also notable that electronic trading has brought the costs of trading down significantly over the last twenty years (mainly through drops in bid/ask spreads), but it's valuable to acknowledge that electronic trading and HFT are not the same thing.



Proprietary Trading Strategies:


When you hear the term "proprietary trading", this basically translates as "taking risk with a firm's money to make more money".


e.g. If i buy SAB Miller shares, because I think they'll go up tomorrow, this would be classed as a form of proprietary trading strategy.


In the context of HFT, proprietary trading strategies can take many forms, with the following three being a couple of examples:

  1. Arbitrage
  2. Front Running 
  3. Predictive strategies


Arbitrage:


This strategy involves taking advantage of mis-pricing of assets in two different places (in the US there are currently 18 different exchanges - six more if you include futures-only exchanges). This can take place through several strategies including, but not limited to:

  • Event Arbitrage - certain events reoccur and these can be taken advantage of.
  • Statistical Arbitrage - exploiting relationships between two linked products (e.g. a currency pair and a forward contract on the same currency pair).


Front Running:


I'm going to cover this in more detail later, but this basically the idea that HFT firms can see what orders you're going to place in the market before they reach the exchange and take advantage of this relationship.



Predictive Strategies:


These can vary hugely in their underlying strategies, but they usually involve the use of quantitative mathematics to predict milliseconds into the future and trade upon these predictions.



High-Frequency Trading Infrastructure:


There are effectively three steps involved with creating an HFT network:

  1. System Owner End
  2. Fiberoptic Network/Microwave Tower Network
  3. Exchange/Data center 

System End:


This is ultimately where the strategy begins its life; where the roots of the logic behind the system is based.


This part of the process is often, but not always, led by programmers, traders and quantitative mathematicians who develop and build the strategies to be executed on trades at/between the stock exchanges. Once developed these strategies are then placed in data centers, where server banks will execute the instructions of the algorithm.


Now in reality, many firms collocate their systems close to the stock exchanges to limit the time lag caused by having long fiberoptic cable networks, so the system end may in reality be pretty close to the exchanges it operates on (in some cases literally right next to the exchange's matching engine). 


Fiberoptic Line/Microwave Tower Line:


In the United States, where HFT has been more prevalent, the systems leaders have tended to employ individuals involved in physics and telecommunications networks to develop this part of the system. 


In some cases the step of laying fiberoptic cable has even involved tunnelling through mountains, the purchase of car parks and agricultural fields and other residential assets so that perfectly straight fiberoptic networks can be laid down - the travel of a fiberoptic network from one side of a road to another can cost as much as 100 nano seconds of time lag.


In order to trade even faster, many HFT firms across the world have been purchasing microwave towers. The map below was taken from a presentation from McKay Brothers co-CEO Stéphane Tyč, showing a map of certain HFT microwave networks in the UK.





Exchange End:


Here is where the system developed executes and trades. If you went into an electronic stock exchange you would really just be entering a server bank that has at its heart a "matching engine", which is where buyers and sellers are paired off with each-other. The HFT firms will have their server banks and data centers close to these exchanges (often right next door in the case of large centers), or sometimes right inside the exchange - many exchanges in the United States can make as much as $70,000 a month for selling proprietary lines to the exchange for HFT traders operating their servers from directly inside the exchange.


Some server banks held near the stock exchanges by the HFT firms will even be tier 4 facilities - they have two of everything inside the data center so that if the system fails the secondary system can takeover and avoid downtime. Other firms are know to have two separate data centers so that if a system failure occurs at the primary data center, the second one can continue as normal.


At the exchange is where the role of the traders in the initial design of the algorithm is essential, because there are over 150 order types used at exchange level in the United States. These order types will be another determinate of the speed at which the HFT system can operate, because certain order types will have precedence over other at the exchange level of the system.


Some order types may focus on:
  • The size of trades on the book on each side (bid/ask).
  • Allowing the HFT firms to withdraw 50% of order when the trade is enacted.
  • Post only orders (the system only trades when a rebate can be gathered from the exchange).

If a liquidity rebate is provided at/between the exchanges where the HFT firm operates, you'll find that HFT firms will have bias to trading here, where they can structure themselves so that the losses they take on making markets at the exchange is outweighed by the money they gain form the liquidity rebate.



Secrecy:

Secrecy has been a key component of the HFT industry since its inception. Primarily this is because if you know how another HFT's system works then you can design yours to take advantage of their system's weaknesses, but furthermore HFT systems don't even like other players to know where they're situated inside a data center - there's a famous case discussed in Michael Lewis' FlashBoys of a firm who covered their server bank with TOYS R US branding to disguise themselves.



Controversies:

The HFT space has been creating global concern since its discovery by the wider finance industry and trading public. These include, but are not limited to:



  • Front running orders via automatic market makers.
  • Flash orders in the United States (this no longer occurs on major US exchanges).
  • 2010 Flash Crash.
  • Euronext/Binkbank "not best execution" order placement at exchanges.
  • Questions over the operation of HFT firms in banking darkpools. 

To generalise, the issues people have raised around HFT usually revolve around the idea that there are slow traders and fast traders. When slow traders (the man trading over the internet connection) are trading against institutions collocating inside the exchange a clear opportunity occurs where the faster player can take advantage of the slower trader.


There's also an argument that there's a conflict of interest in the industry, whereby many of the larger exchanges have shareholders who are very active in the HFT space.

Front Running:


In a nutshell, this is anticipating price movements in the immediate future in an asset and capitalising on cross-market disparities before they are reflected in the public price quotes - or basically you can see what other people are going to do before they do it and suck shares to the HFT firm using an automatic market maker at a low price and then sell them back to the original buyer of those shares at a higher price. 


Firms can do this because their fiberoptic networks and abilities to execute at the exchange are faster than standard trading networks used by institutions and retail traders.

This is also known as "latency arbitrage".


Flash Orders:

This was a feature of some stock exchanges where orders would enter the exchange, be flashed to HFT firms who were then given the opportunity to act on these trades before they were passed on the the wider market.

In the wider context of the stock market, this isn't too different from the initial style of trading on global markets, where an order would come into the exchange via telephone, be picked up by a specialist who would then shout out the trade to the floor before entering it into the computer - where it can be seen by the wider market.


2010 Flash Crash:


In my opinion, this is unfairly attributed to the use of HFT on global stock exchanges, but there is no doubt that HFT did have a place in creating some of the wilder price swings that were witnessed on the day when the Down Jones dropped over 9% only to miraculously recover the majority of this loss.


The cause of the Flash Crash has been directed to a very large billion dollar sale of E-Mini futures contracts through an aggressive algorithm. This algorithm instead of selling a piece of the position and then waiting for a market recovery before selling the next portion, would continuously sell contracts into the market. This selling was then picked up by momentum based HFT firms who would them either sell out of long positions or sell short into the market, thus exacerbating the problem.


For people who are interested, this is a really good documentary about the Flash Crash: 

https://www.youtube.com/watch?v=aq1Ln1UCoEU



BinckBank vs De Giro:


One aspect about this case that's very interesting is that multiple exchanges were only legalised in Europe in 2007 - before then, this wouldn't have happened.


This was quite a large case in central Europe against BinckBank, who were not facilitating the best prices for their clients through their internal matching engine (TOM). At the same time De Giro was also accusing BinckBank of allowing flash trades and front running to occur through their infrastructure.



Dark Pools:


A dark pool is effectively a private stock exchange that stands separate to the public exchanges. The large banks who own these created the under the premise that clients may get a better deal buying/selling through a dark pool than through public exchanges, where their large buy/sell orders may be recognised by the market and act against them.


The issue here arose when claims came forward from major hedge fund mangers that in certain dark pools there was evidence of the front running of orders within the pool. Further to this, it transpired that some large banks would sell access to the dark pool to HFT institutions such as Citadel and Knight Capital Group - allowing the bank to make money taking very low levels of market risk on either end of this deal.



Is High-Frequency Trading a Threat:


This is a personal opinion rather than a fact, but while retail client orders will always be the easiest to take advantage of by HFT strategies, as a result of a lack of the features described above to reduce the time taken to execute trades, unless you are a very active trader of markets or trade in very large size you're unlikely to have a noticeable proportion of your net worth eroded by predatory HFT firms.


If on the other hand you manage large sums of money, there are still ways to avoid the ability of HFT firms to manipulate your orders:


The IEX in the United States is a stock exchange that is being set up to eliminate HFT's effect on their exchange - HFT finds it very hard to operate here because all trades are slowed down to the same speed and thus HFT intermediaries are unable to operate. Also, IEX's investors are primarily mutual funds and hedge funds, which removes some of the argued industrial conflicts of interests in the exchange.


On a more crude level, delays can be programmed into trading platforms so that orders reach different exchanges at the same time - thus stopping HFT entering as an intermediary.



Tuesday, 22 September 2015

Website Development:

Over the next few weeks expect a certain level of disturbance here as new aspects of this site fall into development.

New features will include:


  • Weekly institutional holdings readings holdings across stocks.
  • Weekly scans for popular technical chart patterns.

Sunday, 20 September 2015

Beware of "Institutional Holdings" Trackers - Quindell

Morning all,

A quick post from me to show how we need to be careful of websites that claim to track institutional buying/selling in equity markets.

e.g.


Reuters has QPP's institutional holding level at 20.44% with a net three month change of 26,621,650 shares (90,932,273 shares held in total by institutions):

http://www.reuters.com/finance/stocks/financialHighlights?symbol=QPP.L


Morningstar has this figure (by my calculations) at 10.17% (45,295,100 shares in total held by institutions) and, that i can find, doesn't even mention the recent Beach Point Capital purchase:

http://investors.morningstar.com/ownership/shareholders-concentrated.html?t=QPP&region=gbr&culture=en-US&ownerCountry=USA



Conclusion: Reuters is probably a better resource for this institutional holdings information (this opinion was seconded my my mates in the city - although nothing beats seeing the actual register).


Cheers,

The Masked Stock Trader

Thursday, 23 July 2015

Student Debt - The Next Sub-Prime Crisis?

As far as I am currently aware, very active institutional trading of student debt isn't currently occurring, however I'm going to discuss some reasons why I think it almost certainly will happen over the next decade:



In order to understand this theory, we have to go back seven years to the 2008 financial crisis and the rise of Collateralised Debt Obligations (CDOs).


In effect, a CDO is a group of loans that are packaged together to make a tradable product that can be sold between banking institutions and hedge funds. CDOs have been used in financial markets since 1987, when junk bonds were grouped together by Drexel Burnham Lambert and were initially intended to make the trade of assets with predictable income streams easier (credit card debt, auto loans, etc).


CDOs remained a niche financial instrument until 2004, when the U.S. led housing boom caused a boom in the sale of CDOs, which in turn led to the creation of CDO derivatives (options and swaps) and eventually to the issuing of sub-prime CDOs in the run up to the 2008 crisis.


The use of CDOs to package student debt has been used for the past five years in the U.S., with companies like SLM Corporation leading the way with these products and this is presumably what Arrow Global are doing with the UK student they sold to them in 2013.


The use of CDOs in this fashion remains an excellent idea for the issuers, when we are in a low yield environment in combination with globally low interest rates. However, the nature of many student loans being index linked in some form, means that when either growth or interest rates begin to rise substantially (which regarding economic cycle dynamics means at some point they inevitably will), the default rate and or the rated value on these loans will also fall.


With U.S. student debt now totalling over one-trillion dollars in value, small increases in default rates begin to have much larger value in monetary terms than they otherwise would in smaller markets. This combined with the leverage that derivatives on these CDOs can carry in the over-the-counter markets means that the potential for volatility is likely to high in this debt market over the coming years.




Food for thought....

The Masked Stock Trader



Wednesday, 22 July 2015

What Are Options?

Introduction:


Options are one of the three main derivative types (the other two being futures/forwards and swaps) traded on global exchanges. They are effectively contracts that represent the right to buy or sell an asset (stocks, bonds, foreign currencies, etc) at a certain price.



Technical Terms:


Before we go any further, you need to have a vague idea of what the jargon behind options actually means, so I have made a list of the key terms and their definitions below:


Premium: The amount in currency paid for the contract.


Strike Price: The financial value at which the underlying financial asset can be purchased or sold for.


Expiration Date: The date on which the option contract can be either used or becomes worthless.


Intrinsic Value: The payoff received if the option expired at the current price of the underlying asset.


Time Value: Added value given or taken away from the option due to the value of time (more time gives you more options).


In The Money: An option with a positive intrinsic value


At The Money: An option with a strike price close to the current underlying asset level.


Out of the Money: An option with no intrinsic value, but with time value.



American/European/Bermudan Options:


This has nothing to do with where the options are either listed or traded - a common mistake!


European options can only be exercised at the expiry date, while American options can be used any time before the expiry date.


Bermudan options are effectively in-between American and European options and can be exercised on specific dates/in specific periods.


Types of Option:


Put: This gives the holder of the option the right to sell an underlying asset at a certain price.


Call: This gives the holder of the option the right to buy an underlying asset at a certain price.



The easy way to remember what "put" and "call" mean is to think about it in the context of "putting something away" (getting rid of something) and "calling something towards you" (bringing something closer to you).



Binary/Digital: These are very similar to standard put and call options, but in this context you are either right or wrong on the move in the underlying asset (as standard, they never pay off more than $1).


These are best to use if you believe that the option will finish marginally in the money. If you believe that there's going to be a very large move in the underlying asset, then it is better to pick a standard call over a binary call, because the return you can gain grows linearly at prices above the strike price - you'll make more money.



Convertible Bonds: These work in a very similar manner to bonds, in that they can either pay a stream of coupons or be turned into underlying stock in an asset (prior to the expiration date).


Warrants: Warrants usually have longer lifespans than options and tend to act in the style of American options. They also involve the issuing of new stock at the agreed strike price (rather than the purchasing of existing stock).


LEAPS/FLEX: LEAPS (Long-Term Equity Anticipation Securities) are longer dated calls and puts traded on exchanges with standardised expiration dates in January each year. Time to maturity can last up to three years. These have three strike prices at 20% levels in and out of the money relative to the underlying asset.


FLEX (Flexible Exchange-Traded Options) were listed on the Chicago Options Board Exchange (CBOE) in 1993 and are basically LEAPS with a higher level of customisation in regards to the expiry date and the strike price.


OTC Options: These are simply options not traded on a major exchange (e.g. CBOE), sold between private bodies. These will often carry different rules regarding the payment of premium and are open to a very high level of customisation.



Why trade options?


There are a few reasons why people may decide to trade options, but generally the two main reasons are to either use them to hedge an existing portfolio or alternatively as an instrument of speculation.


To understand why someone may trade an option rather than the underlying asset comes down to something called "gearing". Generally, the term "gearing" is used synonymously with "leverage", which isn't wholly true in the case of options markets:


A Crude Gearing Example:


Let us pretend that The Masked Trader Inc. is trading at $100.

The cost of a $102 call option is $20


There are two ways of potentially profiting here:


1. Buy the underlying stock:


Let us say that the stock rises to $200.

In this case you would make a profit of $100 or 100%.


2. Buy the call option:


If I buy the call option for $20, then at expiry (assuming a European option) I can use this, paying $102 for an asset worth $200. I have paid $20 per option and get back $98. This is a profit of $78 per option, but in percentage terms this amounts to:


value of asset at expiry - strike - cost of call *100
                           cost of call


= 200-102-20   *100
           20             


=390%



That was a rather crude example, but you can see that in percentage terms it makes more sense to purchase the option than it does to purchase the underlying asset in regards to capital growth.











Friday, 26 June 2015

Short Selling Statistics (UK) - When to go long...

Disclaimer: I don't have a licence to give financial advice, so don't view any of the bewlow content as thus.


THIS POST IS UPDATED PERIODICALLY WITH MORE DATA AND ANALYSIS!


Morning (01/07/2015),


I've put together some statistics regarding well known short positions across multiple sectors in UK markets. This data can be used to help determine the levels at which investors could consider going long on other stocks in similar positions.



Known Issues:


1. Historic market capitalisation levels are calculated using the latest shares in issue figures (clearly this number can change and for companies under short pressure I would argue that this is more likely to change than for companies that are not in the same position).


2. I have excluded well known shorted companies that have had the positions taken out as hedges against other positions - the positions I have chosen are aggressive short positions.


3. Data errors can exist and although I have tried to avoid them as much as possible people should be aware of them.


4. Some of the shorts listed below are still active, which means that if another down leg takes place (past the share price low in the below data) then this data will all change.


5. There really need to be hundreds of data points to give a really solid study - so view this as only rough.



Company Market Cap Peak/£bn Share Price High Share Price Low Percentage change/%

Mean Fall/% Mean Fall Companies under £1bn MCap Peak/% Mean Fall Companies Over £1bn MCap Peak/%
Quindell
3.036852
682.50
24.10
-96.47

-68.3010826720286
-74.5074087409454
-65.1979196375702
Tungsten Corp
0.513867475
409.75
52.488
-87.1902379499695




Tullow Oil
14.6821707
1611
278.10
-82.7374301675978




Afren
1.89171248
170.80
1.28
-99.2505854800937




BooHoo
0.626144975
55.75
21
-62.3318385650224




Plus500
0.8972909
781
198
-74.6478873239437




Sainsbury
8.2264596
428
221.10
-48.3411214953271




WM Morrison 8.056.095
345
150.6
-56.3478260869565




Carillion
1.7397029
404.3
294.025
-27.2755379668563




Ashmore Group
3.04106961
429.9
249
-42.079553384508




Nanoco
0.471046245
199.275
83.155
-58.271233220424




Lancashire Holdings
1.8493926
933.00
506
-45.7663451232583




Ocado Group
3.66998335
623.5
216.8
-65.2285485164394




Monitise
1.7903459
82.75
9.53
-88.4833836858006




Blinkx
0.9445401
234.75
23.25
-90.0958466453674







I intend to update this post with graphs confirming or denying any correlations between the peak market capitalisation level and the mean fall of stocks that are being short sold.




Analysis:


1. The mean percentage fall suggests that for companies that are in a bear environment, long positions should be avoided until the company has fallen by at least 50% if you are a buy and hold investor prepared to top up on the way down.



2. Be aware that as you reach the point when you should consider going long, average daily volumes are likely to increase in conjunction with intra-daily price volatility, as short positions exit and long or volatility traders move in and out on swings.



3. Although the data above only gives one example of this, it is generally notable that companies with lower floated share prices fall less under short pressure (I image that this is to do with the implied extra volatility per every 1p change that exists - each penny change in the share price carries more significance for company's value).



4. Statistical Analysis:


- Before you read this, it should be noted that I am not a statistician or mathematician.



- If we have a look at correlations in the data, the Pearson Correlation Coefficients for the data sets (Peak Market Cap vs Percentage Fall) look like this:


Companies Valued Over 1Bn: R= -0.1506

Companies Valued Under 1Bn: R= -0.4886

All Companies: R= -0.0435



- This works between -1 (negative correlation) and +1 (positive correlation). The closer the number is to 0, the weaker the relationship.



- I don't feel that I can safely comment on this data fro reasons I will place in my evaluation, but the data is there for people who find it useful.




- The mean data for share price falls in the table above does suggest however that larger companies (peaking over £1bn in valuation) do fall less than smaller ones (under the peak £1bn market cap).



Evaluation:


This study does sadly have some rather large holes in it:


1. The data sample is very small - 15 companies out of the 1231 companies listed on the LSE (excluding Venture Capital Trusts and Investment Trusts) is hardly a fair study.


- This being said manually sourcing data is hard and time consuming and added to this in the grand scheme of things, there aren't a vast number of short positions over the 2.5% threshold I used (many short positions are merely intended to hedge long positions and can be quite small). Therefore, you could argue that this 2.5% threshold helps to limit the sample size issues.

- It is also worth noting that newer companies are unlikely to quickly build up shorts of over 2.5%, which realistically brings this total sample size down again.



2. There are so many possible variables that I would question if knowing R values is really that useful.

- Also, there are twice as many larger companies in this data set than smaller companies, which again brings into question knowing about the R values and the mean values



Conclusion:


Regardless of the issues with this little study, I think that I personally have learned to avoid trading companies with shorts over 2.5% on the long side until a fall from the peak market cap has been achieved of 50% (across all companies). For smaller companies it does seem that looking for around a 75% fall is sensible, but on balance I would rather trust the larger data set for companies valued at over £1bn.


Enjoy,


The Masked Stock Trader