FXMasterCourse

Trading Order Out of Chaos

  • Facebook
  • LinkedIn
  • RSS
  • Twitter
  • About
  • Trading Approach
  • Resources
  • Forex Tools
    • MT4 Code
    • Tick Data
    • Useful Tools
  • In the Media
  • Testimonials
  • Contact
  • Member Login
You are here: Home / Forex Trading Strategies / High-Frequency Trading from your Living Room

January 21, 2016 by Corvin Codirla 6 Comments

High-Frequency Trading from your Living Room

High-Frequency Trading from your Living Room

High Frequency trading has become both the poster-boy and the scapegoat over the last couple of years in trading circles. It’s been seen as a sure-fire way of making money, as well as a sneaky way the flash-boys tax all the other participants in the market.

In this article I want to cover some of the basics of High-Frequency Trading, as well as how it applies to trading from your “Living Room.” An example of such trading from your own private realm is the following P&L chart showing profits in pips:

HFT Trading PL
HFT Trading PL

This is the P&L chart for “HFT” applied to a major currency pair. Some of the stats:

Trading period 143 minutes
Number of trades 44
Average holding period 10 seconds
Hit rate 82%
Average gain 2.5 pips
Average loss 1.2 pips
Profit factor: 11

And by the way, this was all manual trading.

Now that I’ve got your attention, let me start from the beginning:

  • What is HFT?
  • Who is involved?
  • What’s it like for FX?
  • What it’s it like now?
  • How can we trade it?

HFT Overview

HFT, which stands for High-Frequency Trading, can be broken down into two distinct components.

  • Designing a strategy which produces Alpha (i.e. good predictive signals for price movement)
  • Figure out what the underlying market mechanics are and exploit them

Both of these are strongly interlinked. For starters over very short time horizons, order flow can be modelled quite well. Remember the old saying: I can’t predict what will happen over the next day or month, but I can surely tell you what will happen in the next ten seconds. That’s true for the markets as well.

The problem with this: it doesn’t take a rocket scientist to figure out an alpha model. Let me give you a simple and very naïve example of a trading strategy modelled off tick-data for the 8th January 2016. The P&L is shown here in pips:

Optimistic High Frequency PL
Optimistic High Frequency PL

The problem of course is that assuming 0.6 pips in execution cost (i.e. for one round trip), this system would turn into a straight line down, unless of course signals are taken much more selectively and execution costs are reduced substantially. Latency is also a factor, i.e. speed to execution.

So how do you reduce execution cost?

There are numerous techniques, but all of them rely on following: fast execution and being able to see flow.

Flash Boys in the FX Markets

Now most of you will have read Flash Boys (and if you haven’t you should and then progress to Algorithmic Trading and DMA: An introduction to direct access trading strategies). The main focus there was “latency arbitrage” in the Equity space. In essence not everybody quotes at the same speed. You have multiple exchanges quoting the same stock. But some will have laggy information. You can still trade on that laggy information, but you can also execute on the most up-to-date information on another exchange. In essence you can lock in a profit. Since everybody is looking at this, you have to be fast. Real fast.

So how does this affect the FX Markets? Even more so than Equities, FX is completely decentralized (and also unregulated!).

So this game of arbing out the slow-coaches is a viable sport and many participate in it. They spend millions of dollars to collocate to the futures exchange, and other centers of price dissemination. They aggregate price feeds from lots of banks, and try to gauge flow from interbank data such as EBS and Reuters.

The problem with all this: the more people come onto the scene, and chase the same few models, the less juice there is to be extracted. And indeed over the last few years people have started to leave the HFT space, and look at holding periods which are longer, trying to come up with better alpha signals, rather than improving on execution technology.

But how do we get back to the living room, and the manual trades above?

For that we need to look at the food-chain of price suppliers. Here’s a high-level overview:

FX Market Overview
FX Market Overview

Many details here are removed, but the point is clear: price can definitely vary on different platforms, depending how they are wired and how they choose to stream prices to customers.

B-Book Brokers and Quote Outages

The next point to take into account, and something I had completely overlooked in the previous posts I wrote (see Market Reaction to NFPs): QUOTE OUTAGES. This is where the fun starts. It turns out that a quote outage does not imply “no trading!” I hope you’re keeping up with me here.
Brokers tend to run two books, the so-called A- and B- books. The A-books are pure pass-through books. All trades are immediately offset by the broker with his prime-brokerage or clearing partner. (Of course it’s slightly more intricate, all those micro and mini lot tickets need to be aggregated and gotten rid of in one go). The B-book is interesting. It means that the trade is executed directly with the broker and he keeps the opposite position to you on his books. Why? Here is an interesting statistic, I picked up in 2011. The average retail trader account opening size with a retail broker is £4,000. The retail trader vaporizes that account on average in three months. It therefore makes sense to run a B-book, purely to capture the retail trader’s money! Forget about the tiny commission earned on the retail trader’s trading.
So there you have it, these trades on stale or out-of-sync prices can happen regardless as to what the wider market does, since these B-book trades are done exclusively with the broker as counterparty at a price that he chooses to quote at that moment in time.

Trading Recipe

So what’s the trading recipe? Find a B-book trader with quote outages, which will still trade with you during those episodes. Why would you want to do that? If you have a good price feed that streams uninterrupted prices you have just created a crystal ball to look into the future. You trade on the stale prices, in the knowledge that when price streaming returns you’re in profit. Of course you can also pursue a pure arb-type strategy and lock out profits by trading the two brokerages against each other.

Bam.

Now, you might say, how long does such a market opportunity last for? Well that’s where I had to slap myself. If you look at the previous posts, we are talking 30 seconds or so.

But how much can price move in 30 seconds? It can move several pips during high volatility periods. And when do these high volatility periods happen? During news announcements! The P&L chart at the start of this post comes from trading following the ECB 13:30 GMT press conference today, 21st January 2016!

What’s This Got to do with Vegas and Card Counting?

This is a strategy that well-endowed hedge funds play as well in big, big size. The only problem is that, just like the casinos in Vegas, brokers monitor their players, and also (believe it or not!) talk to each other, just in case a client is playing different brokers off against each other. So these strategies tend to be short lived, unless done surreptitiously. You just have to see what those mobsters in Vegas did to the poor card counters (the movie Casino is a good reference).

From personal experience, clauses such as “strategies should avoid market abuse, ultra-high frequency trading and latency arbitrage, as well as excessive risk trading,” tend to be used as catch-all phrases intended to keep the poor traders at bay from exploiting the plumbing in the market infrastructure.

We’ll follow this post up with some in-depth analysis of the price movements following today’s ECB announcement. Going forward I’ll also be posting comparative analysis between various brokers.

Fun fun fun!

If you have enjoyed this post follow me on Twitter and sign-up to my Newsletter for weekly updates on trading strategies and other market insights!

Filed Under: Forex Trading Strategies Tagged With: ECB, EURUSD, HFT, News Trading

Subscribe to Get the One Exercise which will Improve Your Foreign Exchange Trading Straight Away

  • Get rid of your fear of losing
  • Learn to stick to the rules
  • Achieve a Zen like state when you trade

Comments

  1. Saraiva says

    March 10, 2016 at 11:44 am

    Interesting, but how much time do you have before your broker understand what you are doing? The only way you can make money, is big positions in defined time periods, and probably they will understand that, and move you to A books.

    Reply
    • Corvin Codirla says

      March 10, 2016 at 12:01 pm

      Hi Saraiva,

      You are absolutely right. This is what happened to me. I wrote about it in a follow-up article: http://www.fxmastercourse.com/2016/02/01/fomc-day-how-the-golden-goose-got-cooked-getting-my-a-book-status/

      The problem was not so much making the money, as the fact that I took the leverage to the limit, and made a lot of money very quickly. The change-over to A-book was pretty much instantaneous. Which would indicate it’s an automatic fail-safe they have.

      Reply
      • Saraiva says

        March 10, 2016 at 2:44 pm

        If you don´t mind me asking, what kind of leverage is ” to the limit”?

        Reply
        • Corvin Codirla says

          March 10, 2016 at 4:25 pm

          Hi Saraiva,

          Close to the maximum leverage constraints of the broker.

          Reply
  2. Mr. Sagat says

    March 22, 2018 at 3:54 am

    Only works a few weeks to a month in forex, and then you are out of business.

    Reply
    • admin says

      March 22, 2018 at 3:56 am

      Yup, you’re right. The follow-on article highlights exactly that!

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Browse Topics

Tags

ADP AUDUSD Backtest Bid Ask Bonds Breakout CHFJPY Commodities ECB Economic Indicators Economic Releases Emerging Markets Engulfing Candles Equities EURCHF EURSEK EURUSD FOMC FX G10 GBPUSD HFT Kelly Market Timing Mean Reversion Moon News Events News Trading NFP ORB Performance Measures PPP Python Range Expansion Recession Risk Parity Sharpe Ratio Slippage Solar Eclipse SP500 Trading Systems USD USDCAD USDCHF USDJPY

Subscribe to Get the One Exercise which will Improve Your Foreign Exchange Trading Straight Away

  • Get rid of your fear of losing
  • Learn to stick to the rules
  • Achieve a Zen like state when you trade

Search Site

Testimonials

Python Backtesting

In Part 1 we used simple Python to Improve our Backtesting times.  Starting out with DataFrames we took a simple RSI strategy over a period of 7000 days and reduced from 7.3 seconds (which is a complete joke; sorry Pandas!) down to 0.003 seconds by converting everything to lists. But if you recall the comparison table at the end of Part 1

ImplementationTime for RSI2 Backtests
Python – Lists0.003s
Java0.00005s
C0.…
Improving your Python Backtesting – From DataFrames to Cython [Part 2]
Equities Mean Reversion
Equities mean-reversion works right now. And as part of Building Consistently Profitable Trading Systems it forms a key component. In this article we’ll present the final version of the mean-reversion system to form part of the trading toolbox, and the final portfolio. It’s the Larry Connor’s RSI2 strategy.  And it’s based on the two concepts we covered in Equities and Their Mean Reversion Habits:
  • Looking for a series of down days
  • Looking for reversion towards a short dated movi… Read more
Equities Mean Reversion
EURUSD tick data for the period 31st January 2016 to 5th February 2016. Zip file contains CSV files for each day. The format of the CSV files are: Local Time, Server Time, Server Time Milliseconds, Bid, Ask. The time resolution is in seconds. This means that there can be multiple quotes per second.
Tick Data EURUSD , 20160131 – 20160205, Broker1
EURUSD tick data for the period 14th February 2016 to 19th February 2016. Zip file contains CSV files for each day. The format of the CSV files are: Local Time, Server Time, Server Time Milliseconds, Bid, Ask. The time resolution is in seconds. This means that there can be multiple quotes per second.
Tick Data EURUSD , 20160214 – 20160219, Broker1
Logout
Members
Mean Reversion Currency Trading
Mean Reversion trading works for equities; and currencies. We saw in the last article how combining two simple ideas for equities produced a stable system over the last 30 years. Can we repeat a similar analysis for currencies? Yes!  However, be warned.  Currency trading is a different magnitude of difficulty to equity trading.   Currency traders have had a real tough time since 2008 (take a look at the BTOP Barclay Hedge Currency Trader Index). As always it depends which pond yo… Read more
Trading Mean Reversion in Currencies

© 2023 · FXMasterCourse · Privacy Policy · Terms & Conditions · Earnings Disclaimer

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT