Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is just glorified gambling. I am not sure what special insight or advantage he had, other than his own model. Every trader has a model.

It could have easily been called "how i lost 500k with machine learning". Like gambling, it's easy to manipulate statistics to show that you did well in some period of time.

I worked for a large investment bank about 10 years ago, writing trading programs for quant traders who were market makers. The quants called guys like him "retail" investors and they gleefully picked off all those trades. It's how they made all their money.

So, everyone else, beware of making this a case study in how to make lots of money really fast. You are more likely to lose money.



This. I love crazy projects and Show HN's until the cows come home, but this one is dangerous that I must repeat the warning to others.

I cannot emphasize how important it is to understand that people who trade using price action (http://en.wikipedia.org/wiki/Price_action_trading ) are just speculating based on where they expect the price to move. It's no different than people who play Texas Hold'em online and speculate what cards others have based on betting patterns. If you get good at spotting the patterns (like this guy did) you can go on a winning streak, but when the game changes (as it did for this individual after 2009) then you either go home or go broke.

This guy found one edge in 2009. It won him 500k. Fantastic. More than any edge ever won me. But, the market has changed so much since then, with HFT becoming so prevalent (http://www.theverge.com/2012/8/7/3226187/high-frequency-trad... ) that please be careful before you follow this course. His code is unlikely to be worth much today unmodified, and when you modify it you'll realize, as I have, that when the other players have access to the order books and can jump the line you have no chance in the game in 2012.

One last nit: Please, please post recent data when you talk about projects like this. 2009-2010 is 3 years ago. Since then there was significant turmoil in the US, Asia, and the EU. How are these returns relevant for today?


This is a bit off-topic, but it's actually quite feasible to get a real edge in Hold'em, and it's not just about spotting other people's patterns.

To start with, there's simple probability: knowing the odds of making you hand vs. the payoff in the pot, or the chance of winning with various starting hands. This is pretty basic but a lot of low-stakes players screw it up. If you get it right, their mistakes are your gain.

At a more advanced level, game theory comes into play, using bluffs and so on. The game is complex enough that it's not completely solved, and it's an active area of research. The University of Alberta is doing a lot of working developing poker bots using game theory. By playing a good strategy, you can prevent other players from exploiting your patterns.

Only after you've got a good grasp on all that should you really think much about exploiting a particular player's weaknesses. The Alberta guys are doing work on that part too. Exploitative play can improve your profit but also makes you more vulnerable.

For a good overview of this stuff, the book Mathematics of Poker by Ankenman and Chen is a good place to start.

I agree though that HFT is awfully competitive these days. If I had to choose between the two I'd play poker.


I have done HFT, played heads up semi professionally, and for my bachelors thesis wrote a paper on a PLO playing bot. I studied Alberta's research and it is phenomenal. The parallels that emerge between HFT and a pokerbot is essentially that the architectures of both systems are kind of same and the details are kind of orthogonal. The edge in Hold'em is kind of gone. The 1/2 games right now are as tough as the 25/50 games 5 years ago. PLO is still pretty exploitable though. The same is true with HFT. Most strategies in HFT no longer work but there are definitely ones that still give you a lot of edge-you just have to think harder : )(just like three betting preflop and cbetting the flop doesnt work anymroe).


> just like three betting preflop and cbetting the flop doesnt work anymore.

So true, and frustrating. But, the legalization of online play could bring back another boom at least for a couple of years.


Thanks for posting this so I didn't have too.

Poker is "a game of skill with an element of luck" and should not be confused with say, gambling on roulette or the outcome of a coin toss.


The same could be said of HFT. Traders are "skilled" at having nanosecond access to the orderbook, having their servers co-located in the same rack space as the exchange itself. They are also "skilled" at recognizing a price movement nanoseconds before it actually happens and getting their order in just in time.

But the HFT game changes and you have to keep up. Just as a poker player from 10 years ago would not survive in the game today without adapting his style of play.


Hey, I didn't actually intend this to be a course. I do not make any money in the market right now so am certainly not qualified to teach a course on it. And of course, if I was making money in the market I wouldn't have posted this at all. So please everyone remember that. These comments have made me realize it's probably for the best if I do not post the source code. Basically you are competing against armies of PHDs who are buying buildings next to the exchange so they can get their executions slightly faster. It is indeed surprising to me that I was able to make money in the first place. But I do know for a fact that I did make money and I also know that I was not at risk of losing a bunch of money. As mentioned the most I lost in one day was $2000. That's all I was risking.


FWIW, I couldn't see your pnl chart.

I develop algorithmic strategies for a living, and my first reaction to reading your post was skepticism. I'm skeptical for two reasons. (1) because your methods are so unconventional in an industry where convention rules, and (2) because of the time frame of your success, which happened to be one of the more impressive market recoveries in history.

I can't tell you how many people I've worked with who fail to isolate the source of their pnl (myself included at times). This is key. It's important to benchmark your strategy against other stupid ones that you know don't have edge. When someone shows me strategies that worked in 2009 and 2010, I immediately make them prove their strategy was not the equivalent of being long equities.

Doing this will truly help isolate whether or not luck is involved. When you say that the number and size of your trades justifies the strategy's validity, that's just wrong. You could do 1000 trades in a day: buy 10 RUT futures at the beginning of the day, sell 10 at the end, and just scratch 1 lots for the other 998 trades. In a bull market like 09-10, that would have made 400k, and would have nothing to do with Machine Learning or its applications to HFT.

I make all traders benchmark their work against a series of other strategies that I know have no edge, even though they, at times, can appear to have edge.

Now, I'm not saying you didn't have legitimate edge, but you do your readers a disservice by omitting relevant stats and discussions like that.


> I'm skeptical for two reasons. (1) because your methods are so unconventional in an industry where convention rules, and (2) because of the time frame of your success,

I was also in this business, and there's nothing unconventional about his methods. It would, in fact, closely describe the methods of more than one shop I'm familiar with. (Except they WERE able to overcome the declines). And the 3-6 month indicator lifetime looks eerily familiar.

And these places are anything but "convention rules" - it's "creativity rules, before our competitors get creative enough".

> When someone shows me strategies that worked in 2009 and 2010, I immediately make them prove their strategy was not the equivalent of being long equities.

Assuming the OP is telling the truth, there is no equivalent "long equities" strategy that would make 1500% profit over 6 months (%3000 annualized), with a max drawdown of 20% ($2000 on $10000 - but his max drawdown was probably closer to 5% than to 20%). You are welcome to demonstrate that there is.

Sounds to me like you are doing low frequency strategies; it's a completely different ballgame than HFT. He's done 400,000 trades, half of them long, half of them short. It might have been luck, and he might have been riding something underlying the equities, but this is NOT equivalent to being long equities. He might have found a way to get non-linear leverage (rather than prediction). But that's also worth a lot of money in the right hands.

> buy 10 RUT futures at the beginning of the day, sell 10 at the end, and just scratch 1 lots for the other 998 trades. In a bull market like 09-10, that would have made 400k, and would have nothing to do with Machine Learning or its applications to HFT.

That may be (I wasn't trading in 2009-2010, and don't remember the movements or the required margins), but that would have had much higher volatility (and days with much more than $2000 loss) than the OP had. (Assuming, of course, he is telling the truth)


Thank you. You are right - I should clarify things by saying my program had no directional bias. It was a 50/50 split of longs/shorts. Are there other stats I'm missing?


Given a max loss of 2k, we already know the Sharpe Ratio was pretty good.

2009-10 was more than just a huge rally, it was also a period where vol and skew were massively mispriced. I know this is high frequency, but like I alluded to, you need to make sure that what you're doing isn't replicating the pnl profile of low frequency strategies.

So, how did you perform relative to vol sellers? From the market bottom to the end of 2010, the max daily loss for a vol seller was about 3x average daily pnl, and >80% winners. So your returns do sound better, but not incredibly.

But, even if you failed to perform as well as vol selling did over the same period, that doesn't negate the strategy's validity. If returns were not correlated, then it's safe to say that you weren't just inadvertently shorting vol.

So, start there, work out a regression comparing your daily returns to someone selling vol. Do the same with moving average strategies. Mocking up a simple market making back test versus an ES beta is hard, but that too would be a something to test against. I don't expect you to do any of this, and I'm not going to bother to either. I'm just saying that a complete discussion of this subject would include that information.


vol


Guess you are familiar with http://en.wikipedia.org/wiki/Survivorship_bias? In 2009, there were probably tonnes of people trying to exploit the market using similar low-tech methods as you. Even if all of them were at best break-even, some of them likely made a lot of money on their unprofitable algorithms by pure chance thanks to the size of the cohort. Those few blogged about it and those who lost money didn't. :) I'm not saying that you just were lucky (please dont take this as criticism) - survival bias is just one of those things that always come to mind when people write about how they broke the market or when some investor is presenting his incredibly smart investment strategy that has netted him millions.


It's a great point and seems like a very smart thing to keep in mind. I think in my case, based on the statistics involved, the odds that my success was luck just seems astronomically small. But, guess I'm biased in my own way :)


By luck and skill you found a temporary systematic bias that other players missed. It was even luckier that you found it without a lot of upfront losses. But you could have made many attempts and not found any bias and overall lost money and gave up. If lots of people are losing small sums to find these biases, then it may be that the expected return of trying to find biases is zero or negative.

At best HFT is a near zero sum game. It isn't creating value for customers. It isn't making the world a better place.

It is an unfortunate flaw of our economic system that so many smart people put so much effort into playing zero sum games with each other.


An example of your last point.

I know a very good engineer, who used to design innovative chips for 4G/LTE mobile telephony. These chips contributed to the market position of one of today's leading mobile phone manufacturers.

Today, this engineer is designing ASICs for high frequency trading (basically a specialised Ethernet switch, with all extra logic stripped out, so packets go through a few nanoseconds faster).

HFT isn't a zero sum game. It's sucking resources away from productive disciplines into an unproductive discipline, so making a net negative contribution.


Why are you ignoring HFT's positive contribution?


Could you please elaborate what that contribution is?


It's always the same bullshit excuse: "providing liquidity". It's just that you pretty much need to be another HFT bot to partake in that liquidity.


From what I understood, this contribution is not about making stuff nanoseconds faster, but about how this pushes spreads down. Anyone doing any trading will be happier to see the spreads smaller, wouldn't he?

Note: by spreads I mean the difference between buy and sell prices. I don't know if there is a special word for it in this context.


Exactly. HFT reduces counterparty risk for market makers (because with HFT, it's much more likely that there will be a counterparty for any given trade). This enables the market makers to reduce their bid-ask spreads; the profit from the bid-ask spread is what covers the risk a market maker faces from their market clearing obligations.


Do you know of any data on the size of the spreads over time?


How about efficiency? People call the liquidity providing aspects of HFT 'bullshit', but computers have vastly reduced the manpower necessary to manage a market.

Each futures pit used to have hundreds of traders, who required several assistants/support and commanded a huge salary. Many firms needed multiple traders in a pit, just to be able to make sure they could provide liquidity to all possible market participants. Today, a couple strategists with a small team of programmers can cover dozens of futures markets at once.

The same principle holds across bond, FX, equity and options markets alike. HFT has supplanted a terribly inefficient market with a better one. Is it perfect or even good? Probably not, but it's magnitudes better than the traditional method.


An argument can also be made that this is a net negative contribution, as instead of a market employing hundreds of people, it's only employing dozens. Ergo, more unemployed people. While this is good for the market's owners and those currently employed to trade there, it is bad for the economy as a whole.


You're on Hacker News, but you think that destroying jobs with technological innovation is a bad thing?


Not at all, but in re-reading my comment I can see why you'd think that. My intention was to make a devil's advocate comment: 2 sides to every coin, etc.


There are plenty of arguments for its contribution. I don't need to repeat them.


Please help me understand this better?

With a deep understanding of markets and trading I fail to see why you see 'luck' as an explanatory variable is inversely correlated with the frequency of your trades (notwithstanding the effect of trading expenses)?

From what I have gleaned the following seems to be true: 1. Your algorithms worked (made money) 2. Then your algorithms did not work, but you could not figure out why

If you do not know why something stopped working it seems unlikely that you had a full understanding of why it was working in the first place. Without understanding the nature of the predictive value of the algorithm while it was working, its success seems to be good fortune.

Your algorithm could have shown a systematic correlation to any number of factors that could have created strong performance over several months. Performance would then be attributed to accidentally 'timing' a favorable market.

I know you feel differently, what am I missing?

And either way - kudos on the $500k.


I think you undersell yourself - kudos to your success. I'd back a hacker with a plan (and a cash flow crises perhaps) over an army of PhDs any day! Maybe the course you should think about teaching is how to how to orgainse such a high-quality hack as you've described in the article :)

I'm currently building a semi-high frequency trading solution and the problem I run into is the sheer breadth of expertise you need to get it all happening. Modern chip design, low-latency, lock-free concurrent messaging, fault-tolerant system design, adaptive learning algorithms, k-means clustering and broker APIs are just a smattering of the ideas I'm trying to get across to make progress. For me, algorithm creation comes more easily than reading about and implementing a broker interface.

There is certainly armies of PhDs out there backed by big money but they exist behind heavily guarded intellectual property walls. An open source HFT/Algo/Automated trading platform that brings a hacker sensibility to this problem domain would be seriously competitive.


Thank you for posting this. Very interesting to read.

Perhaps posting the source code would not be a good idea, but posting more details would be welcome so that people interested could follow their own path to automated trading.


I didn't see it in the article and I'm sorry if I missed it... but did you mention what the initial bankroll was?


The Instagram guys found an edge. It won them 730m. Fantastic. More than any edge ever won by me. But the market has changed so much since then, please be careful before you follow this course.

You are not wrong, but what you wrote here is applicable to any success story posted on HN.

Caveat lector. Always.


I think with the automated trading example, it makes it seem much easier for anyone to dip their cup in the stream.

When you think Facebook/Instagram, you think "Damn, those guys got lucky as hell". When you think automated trading, you think, "Hey, it can't be that hard", and start firing up your IDE and rolling out code to talk to an easily provisioned API.

Sure, it may take months to lose your shirt selling a photo service to Face/Goog/Apple. You can lose everything overnight with automated trading.

My father used to trade commodities for a living in the pit at the CME many moons ago, and when I was growing up I would be his technical side when he was trading out of our suburban Chicago home (setting up FM receiver/satellite dish/etc for real time quote data, staying up late nights with him running through trading scenarios in Tradestation on Win3.1 with data downloaded in bulk from Knight Ridder, and so forth).

Something very important I learned from him was: "The market can stay irrational longer than you can stay solvent." With a startup, you can hit bottom. In the right market, bottom is much further down than you can ever see.


> You can lose everything overnight with automated trading.

I'll take it ad absurdum: You can lose everything in a second by not looking left and right while crossing the road. Or even by looking left and right while crossing the road, when someone else is driving recklessly.

It is possible to attempt HFT with not much more risk than stating a new InstaFaceGoogApple service. Put $10,000 in your margin account, and use a broker that practices proper margin checking. Tada! You're not going to lose more than $15,000 over that. (Yes, you can lose more than you put in your margin account, but not by much).

While that's more, upfront, than InstaFaceGoogApple, it is comparable to the 4 months of salary that you're going to forfeit while building the InstaFace service. And unlike most InstaFace apps, you have immediate market feedback, which can only be a good thing.

Note: Instagram did have immediate feedback from the public at large, forcing them to scale much earlier than they expected - but they did not have a feedback as to the financial value of their proposition. In fact, it wouldn't take much for instagram worth to be zero. Read, e.g. http://www.jamesaltucher.com/2011/02/my-name-is-james-a-and-... - a $100M acquisition back then is like a $300M acquisition in today's valuations; not Instagram but definitely nothing to ignore.

> With a startup, you can hit bottom. In the right market, bottom is much further down than you can ever see.

That's true. But you still have to remember that 90% of startups fail, and of those that succeed, many are just moderately successful. And yet no one keeps yelling "but most startups lose money!" at every HN story.

> When you think automated trading, you think, "Hey, it can't be that hard", and start firing up your IDE and rolling out code to talk to an easily provisioned API.

Which is what we should address, and these "it's a gamble" warning do not. When you see Suzanne Vega singing, you might think "Hey, it can't be that hard to sing". Many people do. And yet, they grow out of it, usually without trying to publish an album (and failing). This should be no different.


>>You can lose everything in a second by not looking left and right while crossing the road. Or even by looking left and right while crossing the road, when someone else is driving recklessly.

The point is you are lured into crossing the road, when you absolutely didn't have to.


How are you "lured" by reading an article about someone who successfully crossed the road, any more than you are "lured" into a singing career by reading about Adele or "lured" into building an instagram clone?


No broker is offering the ability to engage in HFT for 10 grand.

In order to open an account with the neccessary infrastructure to engage in HFT one must be an accredited investor (typically means having a net worth of 1 million dollars or more) and the cheapest brokers typically require a minimum deposit of $500,000.

Not to mention the overall costs including hardware, co-location, market data and other vendor costs are on the order of 45-50k a month.

With $10,000 you can't even open up a normal day trading account as the law required a minimum deposit of 25k.


Not true. I have a commodities trading account I use to trade corn, soybeans, and hogs. Minimum opening balance was $5K (Tradestation). Scottrade and others have a minimum of $500. Now if you're talking margin accounts, sure, you're going to need more.


> "The market can stay irrational longer than you can stay solvent."

As long as we're quoting Keynes, let's also remember this gem from a letter he wrote to the regents of King's College about the performance of their endowment's portfolio (which Keynes managed).

"The management of stock exchange investments of any kind is a low pursuit, having very little social value and partaking (at its best) of the nature of a game of skill, from which it is a good thing for most members of our Society to be free; whereas the justification of Worlaby and Elsham lies in its being a constructive and socially beneficial enterprise, where we exercise a genuine entrepreneurial function, in which many of our body can be reasonably and usefully interested. I welcome the fact that the Estates Committee-to judge from their poker faces and imperturbable demeanour-do not take either gains or losses from the Stock Exchange too gravely-they are much more depressed or elated (as the case may be) by farming results. But it may be useful and wise nevertheless, to analyse from time to time what is being done and the principles of our policy."

Edit: Worlaby and Elsham was a farm that the endowment owned.


Wow that is a gem. Keynes was a giant. Wish the political parties wouldn't run from him.


A wonderful quote, but this is the only google result for it. Can you provide a source?


http://www.capitalideasonline.com/articles/index.php?id=2049 claims that it's from a "Memorandum for the Estates Committee, King's College, Cambridge" dated the 8th of May, 1938.


"You can lose everything overnight with automated trading."

Didn't your father teach you about "Stop orders"

You can't have your algorithm cranking away without supervision. And to be extra sure, lots of testing and LIMITS.

Limit the amount and value of orders.

With stocks, worst case: you lose the face value of stocks in your portfolio

Derivatives: you can lose more, even 'infinite liability' (still, it's constrained by the stock market inertia)


Stop orders don't guarantee execution or any specific limit to the loss; During a flash crash, you'll realize that a "10% stop loss" order CAN become a 50% loss.


This. I'm very familiar with stop orders. They're useless once the market goes to hell (the exact conditions you need them in).


I don't disagree with you, still, 50% losses are not 100% losses (or even more than 100% losses)

So I guess they have a role in limiting losses (which had they not been there would be much bigger)


I love this comment :)

What pains me is just this year I've heard in 3 separate occasions for 3 separate startup businesses {industries: ['transportation', 'social', and 'mobile ads']} people propose "Let's do the Instagram strategy." It may be obvious to you and me how absurd that sounds, but there are a non-trivial number of people who blindly follow headlines.

Edit: I agree with @toomuchtodo. It's just too easy to risk with HFT that the warning is needed here more than elsewhere.


Agreed... in essence this is why we're all here. As entrepreneurs we all educated risk takers, and we realize any venture is essentially gambling if there is no edge. At any time, there could be a new idea that pushes any one HFT algorithm (or mobile photo sharing app, or words with friends clone) past the established mindshare into blue ocean territory. When that time comes, do you want to be caught with your pants down, lumbering under the excuse that you thought the oceans were too red for you to bother?


This is a very mean and unconstructive comment to someone who made the impressive achievement of building his own automated trading system and actually making money from it. I've started calling out comments like this one, because they cause a bad environment for useful discussion.

The only argument in your comment that isn't your own unfounded opinion is that market makers make money from people who execute trades. But this is true by definition.

The traders who "gleefully picked off all those trades" weren't outsmarting anyone, they were simply profiting from the difference in the asking and offering price in the market. This is the role of a market maker, and actually makes it cheaper for people like OP to execute a large number of trades. So even though this comment sounds like a sensible rebuttal of the linked article, it doesn't really say anything at all.

Again, sorry for creating a negative reply and contributing to a bad tone, but I really the right thing is to call out these kinds of replies. They discourage honest sharing and discussion.

yajoe's comment is an example of how to criticize a post like this in a useful way. http://news.ycombinator.com/item?id=4748989


While writing his own trading system is a decent accomplishment, due to things such as an overall rising market in the time period involved and survivorship bias, the original author is likely to be completely mistaken about the reason for his winnings.

Given that he might convince other people to engage in high tech gambling in a less-favorable market than the one he operated in, strong words are called for in this case.


You could argue this, but in that case your arguments have to hold water and not just be a cursory dismissal. Ref. yajoe's much more thorough reasoning.


It is only gambling in the sense that any business is gambling: Your customers might stop coming tomorrow because the fad wore off, or a competitor provides a better/cheaper/hipper alternative.

(And indeed, living is gambling. It's all just a matter of the risk/reward portfolie).

But jspauld has apparently made $2/trade after fees on 250,000 trading, with a very small standard deviation (I would guess less than $2/trade) - which makes it one of the best businesses one could ever have.

You can't live without gambling - by e.g. going to be a salaried employee for Yahoo rather than Google or that weird newfangled "TheFacebook" thingy back in 2004, was a gamble.

jspauld, statistically speaking, has made less of a gamble there than almost anyone else posting on HN.

> So, everyone else, beware of making this a case study in how to make lots of money really fast. You are more likely to lose money.

True. But that's true for every single success story posted on HN, reddit, or USAToday.


No. Every business has a risk element, but what makes this gambling is that there is no good or service being produced. It's a game of trying to outguess the other players, with one trader's gain being another trader's loss (relative to market returns).

Because there's a commission on trades, and because you pay taxes on net gains but your minimum tax is zero, high frequency trading by its very nature must a loss for most players.


> No. Every business has a risk element, but what makes this gambling is that there is no good or service being produced.

I was not aware that this is what defines gambling. And "no service produced" is certainly wrong by accepted economic theory - arbitrageurs provide a price discovery service for everyone; they get rewarded for exposing the inefficient prices, even though it is done through market mechanics rather than a specific customer.

OP appears to be a statistical arbitrageur - which is the same concept, except that it includes a shift in time or space (and incurs risk). You might not be interested in this price discovery service, but other people are paying for it with their wallet. (And it's mostly the market makers who pay for this with reduced profits)

> one trader's gain being another trader's loss (relative to market returns).

That's not true in investing in general - when shares have time to appreciate or depreciate, it is definitely not a zero sum game. Everyone can win, or everyone can lose, or anything in between (it all depends on your time range, and your measure of loss or profit. The "non-zero-sum" element arrives partly from companies using operating profit to buy back their own shares).

> Because there's a commission on trades, and because you pay taxes on net gains but your minimum tax is zero, high frequency trading by its very nature must a loss for most players.

That's only true if all players are hf players. If there is sufficient non-HF activity, then the zero-sum argument does not hold.

(I'm not saying that it's not a good approximation - in most time scales, in most scenarios, it is - but it is not the mathematical truth you imply it is)


Futures, which I assume was the original poster's instrument of choice, are a zero sum game by definition as every contract is an agreement between two parties: buyer and seller.


Only if you assume all players only ever use futures. But make an interest synthetic contract (short future long underlying) and you're out of the zero sum regime again. And it's enough that one actor is not inside the zero sum regime to make that apply to the whole game.

Again, it's a great approximation most of time and over most time periods and asset classes, but it is NOT axiomatic in the way most people believe it is.

Remember: as long as there is a way to inject or withdraw more capital into the system (through whatever asset class, as they are all interconnected), the sum is not identically zero.

Just assume one of the stocks is a gold mining company that works efficiently. The share value rises, and the shares are redeemable for the gold, without anyone having to lose anything (except mother earth)


As a professional poker player, analyst and journalist, and being fairly well-read on classifications of gambling vs skill game in different jurisdictions, I have not before come across a definition of gambling that was rooted in the idea that "no good or service is being produced."


Any zero sum or negative expected return conctract would meet this definition (quantitatively). if it floats your boat (makes you hallucinate etc), of course that might be considered a good or service. so you're right, if I was a lawyer those words would be loose language.


So consider an insurance company. This company is engaging in transactions (providing insurance) in which one party will make $X and the other will lose an equal amount of dollars. Would you say that this company is providing no service?

It sounds like you are making the argument that this is zero-sum game, but whether something is zero-sum depends on your utility function. If the players are risk averse, then a transaction like buying insurance can yield positive utility for both participants.

Many trading strategies are performing a service in similar (but more complicated) ways.


Very true, every time you hire someone or spend money on Adwords you're gambling that you'll net more in $$$ or at least lifestyle improvement (in the case of a new employee) than your cost. That is, if you're in business to make a profit, not just spending OPM to build your brand. Even acquiring a customer is a gamble.


Exactly. I've played millions (!) of real-money online poker hands and won some money in the process (not anywhere near what most people who've played that many hands did).

Most people don't understand that, when you're able to recognize patterns, playing millions of hands while never exposing more than 1% of your bankroll on any deal is not "gambling" but "printing money" (a tiny amount of money in my case compared to consulting but that is not the point).

At the same time the very fact that obviously (seen most of the posts here) most people don't understand basic bankroll management, risk management, standard deviation, expected value, variance, etc. means there are probably quite some opportunities out there to make money for those who do understand that ; )


I think the real problem (as with so many problems) is definitional. What does "gambling" actually mean?

If I tried to kludge together a definition, I might come up with something like:

>Risking the loss of something of value in exchange for the possibility of gaining something of greater value in a situation where the determining factor of losing value or gaining value is random chance

The problem with a definition like this is that, as others have pointed out, it applies to vast realms of human endeavor, from founding a company to playing the lottery. It also includes no distinction between risks with a positive expected value and risks with a negative expected value.

If a lottery has ten $1 tickets for sale and each ticket has an equal chance of winning, there is an obvious difference between the prize being $11 and $9, but buying a ticket at either price is just as much "gambling" in the common parlance.

What we really need is a word that only refers to gambling in situations with an expected value less than or equal to zero.


For the sake of clarity, I meant:

>If a lottery has a total of ten $1 tickets for sale and each ticket has an equal chance of winning, there is an obvious difference between the prize being $11 and $9, but buying a ticket at either price is just as much "gambling" in the common parlance.


> What we really need is a word that only refers to gambling in situations with an expected value less than or equal to zero.

I believe we call that gambling.


I'm a pretty risk averse guy and my typical reaction is to figure out why something won't work. One of my pet excuses is that assuming markets are efficient, someone must have already figured this out/ come up with a better exploit, etc. Most of the time I'm right. What troubles me is encapsulated in the following parable:

A UChicago economist and graduate student are walking across campus. The student says ... hey ... there is a hundred dollar bill on the ground! The economist scoffs and says no there isn't ... if there was one, someone must have picked it up already.

Sometimes I catch myself thinking this way. I have to remind myself that (a) markets aren't perfect, and (b) the real world has huge asymmetries in information, ideas, and perhaps willpower (by this, I mean while 100 people might think of a great idea, not all will attempt to implement it; even then, people will differ in execution).

That said, you're likely right. This trading strategy will likely lose money today :-p


It's easy to fall into that mindset. And in fact, that mindset is right back where I am now. The only reason I had the gall to attempt this in the first place was the the simple fact that I was making money at the time (in 2008) 'manually' day trading the Russell 2000. I thought this 'should not be possible' so I figured there's no reason not to try an automated program.


People will tell you that you were just a lucky monkey. But you could have run your algorithm on past data, for hundreds or thousands of fake portfolios, to tell, statistically, what the odds of your algorithm being simply lucky are.

In early 2000s I wrote a machine learning algorithm that beat the S&P 100 with over 1 trillion to 1 odds against it being luck. It predicted a full trading day in advance. But that was all on paper at trading firms' puny costs; unlike you I couldn't beat retail costs. It's amazing that you could do that. For that reason alone I think it's highly likely that you were a skilled monkey.

Also like you, nobody in the industry was interested in my code, even after an industry magazine watched it for 3 months and found it gave "stellar" performance. The few people I was able to discuss it with told me point blank that it was impossible to do it skillfully (efficient market theory), so they assumed it was a hoax or the algorithm was just lucky.


What did you end up doing with your code? Would you be able to run it today with the low-cost broker APIs?


The code sits in one of my archive folders. I ran it for a few years, perhaps to 2004, and saw the market steadily becoming more efficient, lowering my results (like the OP did). It may well be that it no longer predicts skillfully or profitably. As I recall, to beat the market the costs had to be very low, like pennies per trade, with no bid/ask spread, which I understood to be possible for large trading firms.


OK, cool. There are some places that offer equity trading for ~$0.005/share, but that says nothing about overcoming bid/ask. Looks like the OP did that by throwing a bit of market making into the mix.


If you make that many trades and your total market exposure at any given moment is small yet you consistently make a net profit then you've found an edge. At which point it's not really gambling any more, it's just making money!

If your net exposure is small, but that's only because you're offsetting various positions then you're probably picking up nickels in front of the volatility steamroller & if you stay in the market long enough you'll get squashed at some point.


I tried to address this concern at the start of my post. If you have some idea of how I manipulated the statistics I'd be happy to respond.

Having said that I can agree that my case is pretty unusual and that everyone should beware of attempting to do something like this. Even for myself I couldn't do it now. (There is a reason I turned my program off.)


Ie., if you made 500k in one period, but then lost 50k a year for the next 10 years, you've made a net profit of 0. All I know is that you had one good run, similar to how some mutual funds have a good run for a while.

How much did you spend before you "tuned" it? How much did you spend afterwards? What were the tax consequences of your trades? Did you make exactly 500k? Have you traded at all since then?

You mentioned that you occasionally "sat in" and took some large losing positions. Were these on purpose? Bugs? Was your exposure actually much higher than you thought? Was limiting contract size enough risk management?


In my final month I lost $600. I didn't include this on the chart to keep things simpler visually. Since then I have not traded and the reason is that it was abundantly clear that my program was no longer working. That's why I shut it off.

With regard to tuning I may have lost $1000 or so but as I wrote in the article I was able to build a backtesting model that accurately simulated live trading. So once I had that I could basically use it to verify I had sufficient edge to make a profit after covering my commissions.

My risk exposure was very low. When I said large losing positions this meant like $600. But the bottom line is I had a daily stop loss of $3000 enforced at my broker. The most I ever lost was around $2000.

Anyway, there is not really some hidden thing that I am not telling people. It does bug me a bit that your comment is at the top given that it says I'm manipulating statistics and was actually one of the guys that the quants gleefully picked off. I think it's unlikely I traded much with other HFT systems but if I did they certainly lost money.


If you do release the source, what's the best way to be notified of this? Your Twitter account looks pretty active? I'm particularly interested in your risk management strategies (this is where my previous efforts fell short).


Why couldn't you do it now?


Well I could try. But it's not going to be any easier now than it was in 2010. For four months I tried everything I could think of to keep it profitable but in the end nothing worked so I had to shut it off.


I have two theories why it stopped working. I think the market sped up. Latencies are always getting lower and your strategy that worked at 10 ms didn't work with players that are at 1 ms. Also, you might have been gamed because your strategy was easily predictable or you were putting too many trades through the same broker/exchange/etc.


I run an HFT group, and what he describes isn't what we'd call "retail". He was doing a number of things that professional shops do, including making markets to avoid paying the spread and paying attention to queue position to predict execution

With a bit of luck and a good partner, this guy could have built a sustainable business.


I don't get you haters. sure the title is a bit misleading because he never really discusses what his alphas were. But its a pretty good high level description of the architecture of a hft system. I was a quant at GS and these are not the retail investors you pick off. You have your own set of alphas and most of them are meant to pick on mom and pops clicking away at home. This guy didn't reveal his strategy but nevertheless the graph shows his strategy had a significant edge. The lifetime of a strategy also looks like that. It is another thing that his title for the post is kind of off.


There's a sentence in this article that is critical and yet very easy to overlook: the author had 2 years experience daytrading manually. That already gave him a lot of knowledge of how the markets work and where an edge might be found.

I think that if someone is a good programmer and has some mathematical chops and has that kind of experience daytrading, taking a shot at automated trading is probably a reasonable thing for them to do. Without all of that background, you're right, they're almost certain to lose money.


I disagree. The point of the article was the show the steps required to develop a statistical advantage in the market place. If you develop a robust model and are very diligent in how it executes and learns, you can be successful. However, what you say about market structure is true. It goes through periods of stability, followed by abrupt changes. Any model that a trader has developed has been developed on such a short time-scale of market activity, that it can turn out to be a bad sample size. Depends on the scale of time and trades.


You know, that is a really good argument.

Except two things:

1) He didn't lose money, he made 500k.

2) If this worked reliably, you would be out of a job.


Er... it doesn't work reliably, and by definition, cannot work reliably. If market inefficiencies exist to be exploited, then someone is ultimately getting the short end of every stick.


Correct. The far more common story is "how I lost $Xk on the stock market". Probably most people with programming/AI skills have tried their luck with the stock picking problem at one time or another. I have a few times, but only in simulation. Even using very elaborate machine learning methods and a lot of training data, making money from automated trades is a difficult problem, and my impression is that it's very much like betting on horses or football games.


How is it like horses and football games? Don't the latter have a lot more people playing with their emotion rather than utilizing an algorithm? Something that you can take advantage of?


I once worked for a software shop, and part of my job was writing trading code in a proprietary language for customers, who ranged from low end day traders to 8 figure annual revenue hedge funds. I had access to all kinds of tools, and saw many a varied strategy. There's quite a lot of money to be made selling solutions. I won't day trade.


What kind of solutions?


It's more a risk management game, not particularly gambling, just look at EUR/AUD: http://stooq.com/q/?s=euraud&c=3y&t=l&a=ln&b...

Would you dare to "predict" the direction of this FX rate movement in the next month? Then it's a matter of calculating potential profit/loss factor and adjusting your trade value. And yes, as with any high risk investment, putting all your eggs in one bucket is not a brilliant idea. Just like taking all your savings to Vegas.


"Glorified gambling" is a pretty accurate description of this. However, that isn't necessarily a bad thing. If you have a situation where you can gamble with a long-term positive edge, then the proper strategy is to play with as much money and for as long as possible. The determining factor here is whether or not the combination of a particular investor's strategy, algorithm, and ability to execute will give them a long-term edge over others in the market - not whether or not this may be a risky activity in the short-term.


Gambling can be done intelligently and profitably. Don't be so quick to label gambling as a pitfall to be avoided at all costs. I am not a financial expert, but as someone with a background in math/probability based gambling strategies, I can see similarities in the financial markets.


No. This is not. Not ONE gambling. It is thousands of thousands of gamblings with a consistent winning ratio. cannot be oversimplified to a symmetric chance of win or lose.


Uh, if you look at his daily pnl charts, it looks like gambling with some extremely great odds, he rarely looses any money. That pattern is typically associated with HFT, If you can do many small trades and your strategy really has positive expected value you'll get great returns. I don't expect it would work now though, the HFT market is much more competitive these days.


It could have easily been called "how i lost 500k with machine learning".

If you've really worked in that field than it's very surprising you've never heard about what professional poker players call bankroll management (and they "stole" the concept from professional traders).

The whole point is that you can --either if you gain an edge or get lucky-- win big. Very big. But you're never exposing a large part of your funds in the process.

Maybe OP had an overall "stop loss" at, say, $10K. Had he had five minus $2K days in a row at the start, he'd be out. He wouldn't be broke. He wouldn't be without a car and without a bank account. He just would have lost $10K.

But there's no upper limit as to how much you can win.

All you need is discipline and sound bankroll management.

And, yes, I've won a five-digits figure (hence not anywhere near what OP did) real $$$ at online poker. Starting from $0.01/$0.02 small blind/big blind tables and then working my way up using bankroll management.

It's assymetric. You're foolish if you think that succesful traders who won $x were as likely to lose $x. This is simply not how it works and it's very well explained in OP's article. He's detailing what his maximal daily exposure was and it was tiny compared to what he made.


Well put.

Risk management is probably the single most important thing to understand in trading. Unfortunately, it's something that lots of people learn late, if ever.

Folks get caught up in the romantic notion of betting it all and winning big, but end up losers. Meanwhile, the consistent winners they aspire to be are exposing perhaps 0.2% of their roll at a time.


I like the distinction between risk management and the romantic notion of betting it all and winning big. I see the same pattern in other areas as well, e.g. developers who focus on automated testing and other who think it is heroic to modify production code at 2:00 am. I think of it as the cowboys versus the tax accountants.


I actually thought about making that analogy, but it seemed unnecessary as the analogs are just so common.

Though, one thing I think is a bit unique to trading is prevalence of folks who preach without practicing. Just about anyone with a brokerage account can rattle off the same short list of critical do's and don'ts, but very few actually follow them.


I have some friends that have made a lot of money playing poker. The analogy is very good. But, in poker you have to be willing to deal with much bigger ups and downs than what I had to deal with. You can hit a bad streak and it can hurt - even if you are in fact a really skilled player and do in fact have an edge.

With my program I didn't really have bad streaks because my P&L was averaged out over thousands of trades per day.


Not always true. There are plenty of ways to minimize risk.

I played HUSNGs for a living for several years, and I could play three tables at a time (about 9 games per hour) with a 60% winrate. That's incredibly low variance--my graph over the long-term was better than a 45 degree incline.


Yes this is the point I was going to write myself. I played online poker for four years and won over $100,000. I wasn't very good compared to the top 5% of players at my stakes, but I was much better at bankroll management, tilt control, and all of the other soft skills. The way I structured my bankroll made it actually impossible to go broke as well.


Stop-losses are not as effective or nearly as simple as they are described in typical financial media.

http://falkenblog.blogspot.com/2011/02/stop-loss-myth.html (with additional citations in the blog)


I don't get that. It would be true if he just made a few trades, but the author claimed to be making 2000 trades a day. Over a period of months winning that wouldn't qualify as blind luck.


Definitely not blind luck; but boosted by the fact that SPY was on a massive bull run at that time.

This is really cool, any way you cut it.


>Over a period of months winning that wouldn't qualify as blind luck.

Why not?


It's simple statistics. The author was up 4k/day over 120 days. He doesn't say what his daily volatility was, but let's assume 2k (which squares pretty well with his claim that his worst day was a 2k loss).

With a quick bit of R code, we can simulate his PnL over 120 days multiple times, assuming he has no skill, and see what the probability of him being up 4k/day is. I'll use a t-distribution with 3 degrees of freedom, which allows big up and down swings (again, accentuating the effect of luck).

    > pnl <- c()
    > for (i in 1:1000) pnl[i] <- mean(2000 * rt(120, df=3))
    > mean(pnl > 4000)
    0.0
That is, there's a zero percent chance that he would have made those returns if he had no skill. And remember that this simulation is overestimating the effect of luck.


By that definition you could start claiming everything as blind luck. Why bother doing anything at all, let luck do the work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: