Wednesday, October 30, 2013

Directional HFT? you're wasting time

I've met a lot of aspiring traders/analysts who have spent (way too) much time looking for the secret magical formula, pursuing a directional edge within very small time steps; they assume that this is how HFT firms do it, and they are very much wrong.

Paying for liquidity makes it tough

There's only so much vol within short periods of time. If the trader has to pay the bid/offer spread, then the trader might have a negative expectation from the get go.

Transaction Costs

Yeah, there are other fees involved too.

Significantly large edge needed

Therefore, a significantly edge is needed to make this profitable; which is near impossible, unless you can see incoming orders, and get yours executed before theirs... i.e. latency arb it.


Simplest Solution

Stop trying to squeeze blood out of stones; this is a painful path to nowhere.

From my experience, some of the longer term trades make more money because of the low costs around IT infrastructure needs and etc.

Saturday, October 15, 2011

TradeMatrix- free real time NASDAQ OMX and ARCA orderbook viewers

For anyone unsure about an investment with limit order book data subscription, here is a chance to check them out for free. tradematrix.net provides books from the NASDAQ OMX and NYSE ARCA, along with some other tools such as bloomberg TV and etc. 

Reasons to pay attention to the order books

The limit order volumes explain the raw micro-economic forces at work, in theory. Yes there are large order executions through dark pools like liquidnet, yet some of these execution algorithms also pay attention to the order books. It is usually important to develop a feel for where the institutional money's likely to go.

High frequency trading of course applies to order book modeling. I've explained some of the basic strategies in this post, Orderbook High Freuqency Trading Tactics.

Friday, September 9, 2011

Orderbook High Frequency Trading Tactics

This is pretty interesting, and relatively well known today (among institutional traders) content from the market making section of Euan Sinclair book, Option Trading. These are some of the methods applied going back from the floor trading days.

"Mimicry"
Apparently, a good number of questionably inept floor traders made a decent living by identifying competent traders, and basically quoted same prices or took identical trades. In the open outcry setting, it meant holding up same number of fingers; and in today's electronic environment, it means to join competing quotes. While this works "OK" in trading terms, for market makers the issue of inventory management still requires self developed innovation.

The Ratio Trade

Let's say we have the following inside quote for a futures contract,

Ask Size: 300, Ask Price: $1,001
Bid Size: 10, Bid Price: $1,000

Historical stats and economic theory suggests that the mid price is likely to move down as the chance is greater for the arriving market orders to trade through the bid than to lift the offer. Then we naturally want to sell at the offer (Ask) at the price $1,001.

Here is where understanding an exchange's microstructure comes in. Selling at the offer relies on our place in the order queue, Order Matching Algorithms differ between exchanges.
  • If this market applies a pro-rata basis (like the Eurodollar), and we could offer 100 contracts at $1,001, making up say 30% of the Ask Size, then for every 3 contracts bought, we'd be allocated 1. 
  • If this market applies a FIFO (First In First Out) time stamp based policy, we could spam the market with limit orders all over the book at the open, then cancel/hold on to them as the orderbook condition evolves throughout the day for favorable queue positions.
Ticking


A tick is the minimum price increment for a traded instrument. Let's say we have the following inside quote for a futures contract who has a tick size of 1,

Ask Size: 200, Ask Price: $1,005

Bid Size: 10, Bid Price: $1,000

Again, the large offer size is more likely to cause price to drop in the immediate future, and we really like to sell. We could step in front of the offer and make the orderbook look like this:  


Ask Size: 2, Ask Price: $1,004

Bid Size: 10, Bid Price: $1,000

So we have improved the Asking price by a tick. For traders or algorithms without access to the full book, the inside quote now shows a seemingly favorable imbalance making them inclined to fill our offer (hoping to benefit from the ratio trade).

I'm sure this pisses off a lot of traders/market makers.
Oh well, as quoted from Urban Dictionarydon't hate the player, hate the game.

Leaning an order

If weget filled, we immediately bid at $1,001 and make that 3 ticks, and if the order book changes against us, we could always hit the offer at $1,005 to limit the loss at 1 tick. Statistical expectancy off this move's returns differ between instruments, as expected since the respective traders are expected to apply very different algorithms.


Flipping

This is bluffing. Let's say we have the following inside quote in a market with FIFO (First In First Out) policy,

Ask Size: 10, Ask Price: $1,001

Bid Size: 10, Bid Price: $1,000


We can place a large bid to make the book appear unbalanced. Let's say we bid 90 contracts at $1,000

Ask Size: 10, Ask Price: $1,001

Bid Size: 100, Bid Price: $1,000

then we offer 5 contracts at $1,001, so the book state looks like this,


Ask Size: 15, Ask Price: $1,001

Bid Size: 100, Bid Price: $1,000

At this point, most simple algorithms (or traders) would be willing to hit the offer and let us sell at $1,001. There is also the chance of the offer getting traded through stochastic market behavior since we are last in the order queue.

So at this point, if things go according to plan, our offer gets filled at $1,001, and we'd pull our bid immediately. The inside quote becomes something like this:


Ask Size: 5, Ask Price: $1,001

Bid Size: 10, Bid Price: $1,000

The simple algos/traders realize there was no genuine buying pressure, and try to liquidate those futures they just bought; and we have a genuine selling pressure we could cover our short position into for a profit.

Bluff calling


If we suspect someone's flipping the bid, and the book looks like this:

...
Ask Size: 10, Ask Price: $1,005
Ask Size: 10, Ask Price: $1,004
Ask Size: 10, Ask Price: $1,003
Ask Size: 10, Ask Price: $1,002
Ask Size: 15, Ask Price: $1,001
Bid Size: 100, Bid Price: $1,000
Bid Size: 10, Bid Price: $999
Bid Size: 10, Bid Price: $998
Bid Size: 10, Bid Price: $997
Bid Size: 10, Bid Price: $996 
...

We could call their bluff by selling enough contracts at market (hitting the bid), and drive the price down to $997. Let's say we sold 200 contracts, the book now may look like this:


Ask Size: 60, Ask Price: $997

Bid Size: 10, Bid Price: $996

Now the flipper is sitting at a marked-to-market loss of 400 ticks, and the book looks like there's still selling pressure. This could create so much pain for the trader that they liquidate the position, in the process we could cover our short position with a net profit.

Speed and precision

While today's high frequency trading algorithms typically utilize significant complexity, they more or less exploit inefficiencies off the above mentioned core methods. So what is the optimal (highest expected net profit with minimal volatility in return) mixed strategy? Game Theory may offer solutions.



Intuitively, the above strategies require high speed and numerical precision to pull off. Most order book values change within ranges of milliseconds and are in a constant state of flux. This explains why so many of today's elite hedge funds/proprietary trading desks invest so much into IT infrastructure and mathematical ingenuity.


Tuesday, August 2, 2011

Popular Applied Math. Skills on Wall St.

Came across this at Christian Marks.

"
... Wall Street has begun quietly and aggressively recruiting proof theorists and recursion theorists for their expertise in applying ordinal notations and ordinal collapsing functions to high-frequency algorithmic trading

An ordinal notation system is used to name each ordinal in a certain initial subsequence of the countable ordinals; such systems have recently been applied by elite trading operations to the parameterization of families of trading strategies of breathtaking sophistication. Ordinal notation high-frequency trading algorithms, also called ordinal arbitrage systems, pit their strategies against similar algorithmic opponents on electronic exchanges for a few fleeting seconds, during which thousands of trades are executed, including exploratory trades that test the strategies of opposing human and machine traders.


The monetary advantage of the current strategy is rapidly exhausted after a lifetime of approximately four seconds–an eternity for a machine, but barely enough time for a human to begin to comprehend what happened. The algorithm then switches to another trading strategy of higher ordinal rank, and uses this for a few seconds on one or more electronic exchanges, and so on, while opponent algorithms attempt the same maneuvers, risking billions of dollars in the process. The elusive and highly coveted positions for proof theorists on Wall Street, where they are known as trans-quantitative analysts, have not been advertised, to the chagrin of executive recruiters who work on commission. Elite hedge funds and bank holding companies have been discreetly approaching mathematical logicians who have programming experience and who are familiar with arcane software such as the ordinal calculator. A few logicians were offered seven figure salaries, according to a source who was not authorized to speak on the matter.
"

Set Theory is Ph.D material. Game theory is postgrad as well, and is probably also a necessity to accomplish the above. Is it really necessary to learn all this to make money? Probably not. At the same time, Wall St. technology and application of advanced mathematics are growing so rapidly that it would likely become necessary to understand these concepts to go toe to toe on the institutional level.

Here's a research paper applying a Set Theory based algorithm to trade Indian stocks for a positive expectancy.

Thursday, June 9, 2011

Adaptive Strategies for High Frequency Trading (research review)

Anderson, Merolla, and Pribula looked at the eminiS&P500 orderbook for their paper,  Adaptive Strategies for High Frequency Trading . They explained some fundamental concepts around applying orderbook volumes, with respect to their levels, to have an idea of where prices (bids/asks) will likely go in the extreme near term future. This is somewhat intuitive as it is in line with general ideas of exchange level supply and demand.

Forecast methods discussed applying best bid/ask Prices using orderbook volumes: 
  1. Mean Squared Error Prediction
  2. Support Vector Machines
  3. Independent Component Analysis
  4. Simple Moving Average
 Tested Trading Strategy

All market making. Basically, using the forecast value for directional bias, and spam the market with limit orders; e.g. if forecast says the inside Ask price will be higher, the strategy would start working the current best Bid and the expected Ask; and vice-versa. That's the rough idea.

So yeah, interesting research paper for anyone looking to learn about high frequency trading.

Wednesday, October 27, 2010

Intro to High Frequency Finance (Book Review)


Some of the folks at university probably think I'm crazy to spend time on all this non-school related material when final exams are next week... Any way, this was a pretty good, i.e. useful book for a couple of writers with backgrounds in academia. Some of the ideas were practical in real time trading for me, especially the stuff around conditional correlations, seasonal volatility, and rolling regressions.


The good

Lots of descriptive concepts around data analysis, modeling, and trading strategy development. Some of the ideas like normalizing returns via mapping operators to take care of the skew issue with correlations could definitely help improve the trading algorithm development process. The summarized stylized facts could help any new reader become familiar with general statistics of high frequency financial time series.


The less-than-good

It felt like they might have made some things a bit more complicated than necessary.

Over all assessment

It's got some good ideas.