
Real money, invested with algorithms - twiecki
http://blog.quantopian.com/real-money/
======
gbasin
Some other commenters have hinted at this but... I feel sad whenever people
build this kind of stuff. It's probably a very well built product (or will be)
and is better than the alternatives out there, but the unfortunate fact is
that anything that enables and encourages active trading in modern financial
markets is setting 99% of their customers up for failure. And the 1% that are
actually on to something will quickly move off the platform onto their own, or
will end up losing whatever they make when their strategy loses whatever alpha
it has and they can't admit it (I've seen this happen, but never the former,
actually).

Trading is hard. I run a proprietary trading firm with modern technology
infrastructure and we have a lot of trading experience. You really have very
little chance of success unless you're doing this full time, and even then it
will take years before you have enough experience to build a sustainable
income.

~~~
gnaritas
Everything you said could practically be applied to any skilled profession.
Being an X is hard, 99% of people fail at X. What makes trading any harder
than programming or engineering or abstract mathematics or physics? Successful
traders exist, plenty of people trade for a living. People have to try
something to see if it's something they're good at and most people aren't good
at most things. Pointing that out X is hard and most people fail is a
tautology, it's true of all difficult professions.

~~~
lutusp
> What makes trading any harder than programming or engineering or abstract
> mathematics or physics?

That's easy to answer -- if you're very smart, you will do better in math and
physics, and the positive correlation between intelligence and success
actually has meaning. But in equities trading, being very smart does no good
at all, and might even represent a handicap. The reason? Equity pricing is
mostly random noise, very high entropy.

Many very smart people have tried to model and then beat the market, and
(apart from chance outcomes) no one has succeeded in the sense that they
located a reliable, describable "method" for it.

Also, if in principle someone discovered an actual winning system, by
publishing the system he would destroy its effectiveness (because once a
"system" is put into practice, once everyone uses it, it loses its
effectiveness).

Obviously for a random collection of investment schemes, half will do better,
and half worse, than the average market, but the half that do better will
naturally enough claim the outcome resulted from their investment genius --
even if they're smart enough that they should know better.

I can use a computer to model a random market and random investors, using
random price changes and random trades, and not surprisingly, half the
investors will do better than the average outcome. What is surprising is that,
when the above-average investors are humans, they invariably try to claim this
chance outcome resulted from a winning system that they will sell to you for
some princely sum.

More here:
[http://arachnoid.com/equities_myths](http://arachnoid.com/equities_myths)

> Pointing that out X is hard and most people fail is a tautology, it's true
> of all difficult professions.

Yes, but there's a qualitative difference between "hard" and "impossible".

~~~
throwawaymsft
You're basically saying investing is random chance. Ok.

What is the p-value that Warren Buffett's random investment plan outperforms
the market 39/47 years?

[http://finance.fortune.cnn.com/2012/02/25/buffett-
berkshire-...](http://finance.fortune.cnn.com/2012/02/25/buffett-berkshire-
hathaway-results/)

If a drug beat a placebo in 39/47 experiments, would it be approved by the
FDA? :-)

There are investors who get lucky, and there are investors with sound
strategies. The notion that every winning strategy gets immediately and
flawlessly applied by every actor in the market is a fantasy world populated
by homo economicus.

~~~
lutusp
> You're basically saying investing is random chance.

No, what I am saying is that random choices can produce the illusion of
successful investment strategies for 1/2 the practitioners. This isn't at all
controversial -- it's equivalent to saying that half of people are above
average in intelligence.

> What is the p-value that Warren Buffett's random investment plan outperforms
> the market 39/47 years?

That's not a particularly interesting question (and it's not an improbable
unbroken streak of 39 years, but a mixture of successes and failures, much
more likely to result from chance). What is more interesting is to ask what
Buffett's market performance would have been without the announcement and herd
effects? Everyone wants to invest in the same stocks Buffett invests in, and
Buffet's investments are public knowledge. The herd can be relied on to make
Buffett's choices _after_ he has established his position, which means he's
positioned to benefit from the public's responses to his choices.

Again, I never claimed that investing is random choice. I only said that
random choices work for 1/2 the investors, and those investors are likely to
attribute their success to genius instead of chance.

~~~
alsocasey
Perhaps more to the point: Buffet's results are unlikely (though likely the
result of many different strategies, some successful, others not...), but in a
market with so many investors, it is perhaps not so surprising that one so
successful arose?

~~~
gnaritas
> Buffet's results are unlikely

That wasn't Buffets point; his point is that those who followed certain
strategies of value investing consistently win and he gave examples. That's
more than a random outcome.

~~~
lutusp
> That wasn't Buffets point; his point is that those who followed certain
> strategies of value investing consistently win and he gave examples.

"Consistently win" is obviously false. If someone had an actual method (not a
random unexplained event) _with a description, that could be tested_ and that
could consistently beat market averages, it would surely be applied and the
market would collapse. The market didn't collapse, so there is no such method.

How is that so hard to figure out? _There is no winning strategy, no secrets
of the winners_. There are people who make more than others in equities, but
not because of a describable, scientifically testable system.

When a scientist encounters a description like this, he always assumes _a
priori_ that it's chance. That agrees with the null hypothesis and Occam's
razor. It also keeps people from selling him worthless investment books.

~~~
throwawaymsft
You're restricting yourself with the giant caveat that the system must be
perfectly deterministic (i.e. capable of being executed by code). Why? For the
convenience of your testing?

An analogy: humans have beaten computers at Go for decades. Is the human
strategy random chance? It must be, since they cannot write down their
algorithm so well that anyone else can be a Go master!

Go strategy (similar to investment strategy) cannot be perfectly laid down
(though the general principles can), and yet the results are clear. Would you
argue there is nobody inherently better at Go than anyone else? Even if they
are the best performing Go-perfomer ever, who has beaten every computer system
for decades and decades?

I'm not sure how much of a butt-kicking Buffett needs to perform against the
market for you to believe there may be an element of skill at play.

------
aleyan
Congratulations to the quantopian team.

Trading on real data is very different from simulated trading on historic
data. There are a lot of leaky abstractions and assumptions that happen during
simulations that cause problems once you put real money to work. In the past,
here on HN, I have criticized quantopian several times because no one has
actually used quantopian to trade real money. This is no longer true.

It will take a lot of time and a lot more capital to figure out all the holes,
but they are finally on the right track and I am glad they have 20 people
already trading. That is 20 sets of eyes balls to look for lack of fidelity in
the simulations.

Personally I am interested to see how good their transaction cost model is
when trading hundreds to thousands of shares at a clip.

~~~
novaleaf
very interesting!!! but I'd like to try writing my own algorithm offline, in
my own prefered language. (javascript)

does anyone know where I can get price history for the last few years for
something like an index fund, like DIA?

~~~
wkneepkens
Yahoo Finance is a good option, also have an API.

~~~
novaleaf
thanks, i'll give that a try

------
ForHackernews
Sweet. This is perfect for those of us who still have some money we didn't put
into MtGox left to lose!

------
junto
I'd love to have a go at this but I haven't a clue where to even start. Any
tips as to where I should start reading?

~~~
adeychi
To get started on Quantopian, take a look at the FAQ
([https://www.quantopian.com/faq](https://www.quantopian.com/faq)) and help
documentation
([https://www.quantopian.com/help](https://www.quantopian.com/help)). The
platform runs entirely on Python and supports US stocks and equities.

To begin coding, clone the sample algorithm on the front page to get
familiarized with the IDE. You can then backtest the strategy, for free, using
historical data from 2002 - Now. When you run a full backtest, you can see how
your algorithm would have performed in the past - you can see your returns,
Sharpe ratio, and other metrics.

Once you're comfortable with the syntax and mechanisms, the community is a
great place to look for trading ideas to try on your own. Try cloning an
algorithm posted in a thread to begin experimenting. If you get stuck, post to
the forums - they're a friendly bunch and will be happy to help out.

Of course, past performance is not indicative of future results. When you're
ready, you can paper-trade your algo (trade using fake money) on the live
market. It's free on Quantopian and a risk-free method to see how your algo
performs in the market. And then, the last step is to connect your account to
Interactive Brokers and begin live trading with real money. This blog post was
an update of the live trading pilot program.

(Disclaimer: I work for Quantopian. But I'd be happy to help answer any
questions! Feel free to reach out to us directly as well,
feedback@quantopian.com)

~~~
wagerlabs
How does Quantopian connect to IB?

Doesn't IB require a local TWS connection as well as credentials, e.g.
2-factor authentication?

~~~
adeychi
We run an IB gateway and in the Quantopian UI you enter your IB credentials -
but we do not store your password. You then deploy your algo and see a
dashboard with updates from the market.

Fore more info see:
[https://www.youtube.com/watch?v=hye1L86s43M](https://www.youtube.com/watch?v=hye1L86s43M)

------
IBM
Stick with value investing (or index investing if you don't have the
skill/discipline/time for it).

~~~
minimax
You could try and write an algo that would carry out your value investing
strategy. You could trawl Yahoo for P/E or whatever value metrics you want to
look at buy or sell based on certain thresholds.

~~~
gbasin
Successfully implementing a value strategy cannot be codified into an algo

EDIT: There are just too many exceptions and nuances. Every single investment
involves more exceptions and nuances that would need to be coded. And if you
don't think so, I would bet you don't have alpha :)

~~~
nissimk
I guess I'm agreeing with your statement "Successfully," but it doesn't mean
it hasn't been tried:

[http://www.jatit.org/volumes/Vol51No1/24Vol51No1.pdf](http://www.jatit.org/volumes/Vol51No1/24Vol51No1.pdf)

Also, weren't the quant funds that were involved in the summer 2007 blowup all
running automated value strategies based on Fama+French factor models?

It works really great until it doesn't.

~~~
gbasin
Oh plenty of tryers. Value investing is a lot harder than it looks. And what
you're talking about isn't really the definition of value investing (like
graham-dodd + infinite details on the individual companies). Those quant funds
were running factor models and mid-frequency stat arb

------
jgh
I've really enjoyed playing with Quantopian, and I think that I will continue
to play with it as an educational tool. However my algorithms so far have been
very good at losing an awful lot of money, so I think I will be sticking with
simulations for now :)

~~~
lucisferre
> my algorithms so far have been very good at losing an awful lot of money

But... the solution is just so obvious, just make the algorithm trade the
_opposite_ of what it would have done.

Pure profit!

~~~
nick_dm
A few years ago I heard a story from an acquaintance working at an online
spread betting company. One senior figure suggested that they should actively
bet against their worst performing customers rather than hedging, they
discovered pretty quickly that this wasn't a good idea!

~~~
seunosewa
What happened when they tried it?

------
pontifier
This is quite interesting. I had just built a predictive rebalancing bot to
trade on MtGox a few hours before it collapsed. I was rebalancing every 60
seconds and making lots of trades. I only got a couple of hours of run time
before it stopped working :(

Here's the bot I built:
[https://github.com/pontifier/rebalancer](https://github.com/pontifier/rebalancer)

Quantopian looks interesting, and hopefully the exchanges it trades on won't
disappear.

~~~
gedrap
Doubt that. NYSE is definitely a scam. I have heard they pivoted from creating
a new social network, like Facebook just better.

------
citanul
It seems the natural next step would be to allow non-algorithm writers to
invest in algorithms (or a bundle of algorithms), with some fee going to
either or both Quantopian or the writer of the algorithm(s). Any chance that's
on the roadmap, and if so, when can I expect to be able to crowdsource my
investing?

~~~
eclipxe
If only there was some way to invest in an index of some sort of the best
algorithms...

~~~
nicolethenerd
But what you don't get with an index (at least, I don't think you do? I admit
my ignorance on this) is the sort of transparency and ability to dig deep into
the algorithm(s) that it appears you'd get with something like Quantopian. And
possibly the ability to tweak that algorithm. Basically, a market for starter
Quantopian algorithms that are more advanced than the samples on the site - I
think that's vastly different than an index, and I could see paying for
something like that.

~~~
yarou
Sure you do. All index funds disclose their holdings, and index ETFs show
their constituent equities, along with any tracking error from the index being
tracked. A long time ago, "proprietary" traders would perform index arbitrage
in this fashion.

------
agilebyte
Can anyone in the know tell me why traders are not interested more in sports
betting? Seems like you have a lot more people betting with heart then brain
which should result in a profit if you employ all your fancy algorithms no?

------
vijucat
I've always found
[https://www.quantconnect.com/](https://www.quantconnect.com/) more
interesting. They're just not as good as Quantopian at generating some buzz.

------
Ecio78
For those interested in doing some algo testing I found this site quite
interesting:
[http://systematicinvestor.wordpress.com/](http://systematicinvestor.wordpress.com/)

------
monksy
The only issue that I have with that is that they require an IB account. That
has a min of $10k. Thats not exactly easy to come by.

~~~
cpwright
If you don't have $10,000 to risk, you probably shouldn't attempt to trade in
an automated fashion. You need enough capital, because any one trade is likely
to have a small percentage upside and you need to turn it over frequently.

------
EGreg
For the next week my comments on Hacker News -- except this one -- will
attempt to garner as many points as possible by exploiting various HN
tendencies.

Feel free to upvote this comment if you think this is cool btw :)

------
watermarkcamera
can I add comment ?

