
Algorithmic Trading: The Play-at-Home Version - likeapub
http://www.wsj.com/articles/an-algo-and-a-dream-for-day-traders-1439160100?
======
chollida1
Here's the problem with trying to create your own trading system.

How do you back test it to know that it works. If you back test over the past
5 years then you are only testing your model against a huge bull market.

If you back test over the past 20 years then I'm not sure it helps much as the
market of 20 years ago didn't really have any of the major market drives of
today's markets, HFT's, huge numbers of hedge funds and the money they bring,
and huge passive investing via ETF's, all those factors were there 20 years
ago, but they weren't the major market drivers that they are now.

So for back testing you are damned if you do and damned if you don't:(

I think I've said this before but in my experience, a decent trading system is
70%+ market insight. And there are only really 3 ways to get this insight,
hard earned experience, applying new streams of data to the markets and
applying math to existing streams of data to unlock new insights.

All 3 are being done every day by scores of MIT Phd's.

So if you are writing your own trading models you should start by answering
the question of what's your alpha when compared to everyone else....

~~~
ericjang
One clarification - these mom & pop prop shops aren't necessarily competing
against big baskets of MIT PhDs. If your book size is only $200K, the big
players (i.e. scores of MIT PhDs) won't even bother competing with you on the
same strategies. Alpha from these strategies may very well be orthogonal to
hedge fund alpha.

That said, you're still playing a zero sum game with other mom & pop shops and
the general large-scale movements of the market. You need to be confident that
you have better information / forecasting ability than the others, or
technology infrastructure that enables strategies no one else can execute.

Source: I work in the industry.

~~~
exelius
Yeah, most people don't realize that finance is a zero-sum game. That leads to
arms races which over time remove the lion's share of the profit (companies
will spend money on a better solution to a problem until such time as a better
solution costs more than the value of the opportunity).

I expect this to replicate itself on the low-end as well.

~~~
joosters
The 'zero-sum game' part is meaningless and adds no insight here. It doesn't
matter whether you believe trading/gambling is zero-sum or not.

For instance, imagine you have a poker-playing bot at a poker table, where the
house takes no cut of the stakes. Zero-sum? Yes. But your bot has to be better
than the other players, and win more than its running costs in order to
profit. Now imagine the same situation but the house _does_ take a cut. Zero-
sum? Not any more. But your bot still has to be better than the other players
and its running costs in order to profit. The house 'rake' just increases your
operating costs.

I think you are confusing the issue with large scale HFT (where companies pay
more and more for slightly faster comms), which is a world away from the
trading strategies the article is talking about.

~~~
SonicSoul
Think you missed the point. All he was saying (I believe) that no matter how
good your models are it's still a race between the players to get the biggest
share of the pot. The more players the less chance you have

~~~
joosters
That's true of many endeavors, and is unrelated to any 'zero-sum' argument.

------
noname123
Interesting article but for a different take on a statistical approach to the
market, curious if any peeps on HN are into volatility trading?

From what I understand a lot of the "DIY vendors" cater to the equity crowd,
meaning people who build their models on technical indicators (MACD, RSI,
advancers/decliners ratio, Fibonacci golden ratio retracement, MA); you build
your model of some combined signals, back-test it with historical data on some
tickers to see if it's promising.

I trade options, specifically selling 1.8-2 sigma calls and puts (with 90%-95%
probability of not being in the money) on the major market indices (SPX, RUT,
NDX) 45 days out from expirations; so kinda of like an insurance company
underwriting policy or a bookie taking bets from both sides.

When the market moves against me (e.g., Grexit), I try to hedge my exposure to
that side of the market by buying a longer dated call and put neutralizing the
delta of my overall book (kind of like going to the re-insurance market to
hedge my book); and also adjust the spread or close it entirely for a loss if
risk/reward no longer works out.

But I never trade directional or have any market outlook; and do this
systematically and only thing I change is sizing my book depending on how high
VIX is (insurance premium/market fear).

This is a well-documented and traded strategy for peeps who follow, say
TastyTrade, volatility arbitrage funds or just options in general. Just
curious if anyone here also trades this way?

~~~
rbinv
If all those TastyTrade strategies work, why isn't it being automated and
backed by significant funding? Serious question.

~~~
gnaritas
Because significant funding requires significant liquidity and strategies that
work for an individual trader can exploit being small to find opportunities
too small for big money to bother chasing. Small players can enter and exit
trades instantly with little slippage, big players move the market and have to
play a very different game to open large positions.

------
lukebuehler
It absolutely can be done. I know a handful of people who are doing well, or
have spun a small hedge fund out of their DIY trading system.

Having said that, it's hard. Most people simply don't have the bandwidth to do
it properly. Parsing daily Yahoo prices and having a R script or two somewhere
will absolutely not put you in the "I do successful algo trading" camp. Or
running TradeStation with a handful of pair strategies or whatever.

So I differentiate between them and people who write more serious automated
algos. I'm sure in the first camp there are some that make profits, but as
someone said here already, It's usually a zero sum game.

Who are the more serious DIY traders? Hard to define but if they do most of
those things I'd say they are in the small camp of home traders that often
make money.

\- Willing to fork up the money for good historical intraday data (10 years of
US intraday data from Nanex cost about USD 30K). I'm super serious about this,
if people even blink an eye here, I'd walk away. They don't understand how
important data is.

\- Build a proper security master database, or buy a security master feed.
This is a project of blood sweat and tears. Every day securities need to be
resolved. Again if building this out of, e.g., Bloomberg data, quite some
money has to be invested.

\- Have a sophisticated back-test system where they can simulate models
against MANY traded stocks concurrently. Meaning, they can back-test making
decision tick by tick, or second by second, against a large universe of
instruments, for example 3000 US stocks. This can be slightly eased by doing
some daily preselection, but usually good strategies still scan hundreds of
stocks real-time.

\- Have the ability to execute this stuff live. IMHO, the article is right to
mention Interactive Brokers for this, they are one of the best in this kind of
setup.

(Only now are we where most people try to start) \- Have the stats, math and
dev chops to find and implement a profitable model/strategy. I have to say
though, while still difficult, there are many untapped possibilities to make
some money. But once decided on a general direction the "time to market" is
still often at least half a year. Many give up before that...

There are some more things I'd look for but this is the main list I'd say.

~~~
e15ctr0n
> Or running TradeStation with a handful of pair strategies or whatever.

You can now buy trading strategies from their TradingApp Store. Supposedly,
they've been written by professional algorithmic traders.

[https://www.tradestation.com/trading-
technology/tradestation...](https://www.tradestation.com/trading-
technology/tradestation-platform/extend/tradingapp-store)

[https://tradestation.tradingappstore.com/search/all/Rating](https://tradestation.tradingappstore.com/search/all/Rating)

~~~
Havoc
>Supposedly, they've been written by professional algorithmic traders

And discarded by them as not profitable enough for their own use.

------
siavosh
How is this new? The first time I setup my own linux server was at my parent's
house, so I could write a crawler to collect market data in the hopes of
applying some AI technique for market predictions. This was 10 years ago. It's
a lot of programmers dream to write a little program that can print money.
Afterwards I went and worked on wallstreet, and realized how foolish this was.

~~~
baudehlo
If you learn something while writing it, and it sits and earns a little bit of
money without much work, then it's not really foolish. I bet you learned more
doing that project, things that probably helped get you that Wall Street job,
than you seem to estimate now.

~~~
siavosh
Sure there's always value in doing. What I believe is foolish after learning
more about what the industry does is the belief that a DIY program can
actually make money.

~~~
baudehlo
You probably can't beat the market. But if you can beat a savings account
earning 2% interest it's probably worth it for the learning experience.

~~~
siavosh
Well, you'd have to beat 2% + transaction fees + capital gains which would
mean you'd have to beat the market.

~~~
TuringNYC
Not quite -- even if you match the market or slightly under-perform the
market, it might still make sense if you achieve these results with lesser
volatility and more consistent earnings. I do not necessarily want to beat a
market which returns 7% on average but loses 40% every 6 years...

------
Animats
That's been going on since the late 1970s, when personal computers first
became available. It worked back then, because few were doing algorithmic
trading at the time. Now, everybody is.

There's new interest in systems which look at external data sources such as
news items, rather than just at market data.[1] They have a chance of picking
up something before the market reacts. But that's already widely deployed;
about 15% of HFT operations were using it by 2013.[2]

[1]
[http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2326414](http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2326414)
[2] [http://www.automatedtrader.net/online-exclusive/67056/fit-
to...](http://www.automatedtrader.net/online-exclusive/67056/fit-to-fade-news-
driven-algorithmic-trading-strategies)

~~~
joosters
Algorithmic trading is more than just HFT, where every microsecond counts, and
where these small-scale day traders cannot compete.

Your example of analysing new items is a good one. If you can spot a better
way to predict stock or currency movements by a cunning new way of processing
news feeds, then you could potentially profit from it without having to rely
on speed of execution.

People have been using computers to do stock analysis, as you say. But this
doesn't make it a solved problem. There's money to be made if you can do it
better than the others. Of course, the competition is very tough.

------
tunesmith
I've always been confused why so much of algorithmic trading centers on
technical indicators. What about fundamentals? Wouldn't it be easier to cobble
together a system that checks for healthy companies that are low in their PEG
ratio historical range, and then buy-and-hold? There are super-boring
companies with reliable earnings history out there, with stock prices that go
up and down throughout the year. So you'd be trading a few times a month, not
many times a day (or minute).

Then there are the simple algorithms like 'Just buy index funds', although I
haven't found a good resource on how to sector-balance various index funds.
Simplest I guess would be 'Just buy VFINX' but that can be volatile and scary
sometimes.

~~~
karmapolice
How easy is for a bot to read fundamentals? I do not know if there is some
place to gather this kind of data.

I mean, in "The intelligent investor" the author points out that lots of
companies bury important information in side notes in their annual reports,
that can totally change their attractiveness.

I wonder how easy is to check these things nowadays.

~~~
tunesmith
That data set is harder to come by, which really sucks... morningstar has
something like that - historical fundamentals - and they charge a ton. But I
think Quantopian gives access to it? Not sure if others do. And there might be
ways for other services to bundle it somehow across many subscribers.

------
tdees40
Whenever people tell me they're going to go into day trading, I usually say,
"How many people do you know who've become wealthy day trading?" They say,
"Zero." I also know zero people who got rich doing at-home algorithmic
trading. But hey, there are probably some! That's the nature of randomness.

~~~
des429
This seems like nonsense to me. How many Phd's are awarded every year? Doesnt
mean its a random occurrence... I know quite a few independent day traders who
do quite well. I think its about who you know-- i.e if you are working in
Finance you'll know more day traders.

~~~
jsprogrammer
Have you seen their trade logs?

~~~
des429
Just a few of them.

------
cdvonstinkpot
I once used a Bitcoin trading bot with some luck- called 'Butter-Bot'. It had
the ability to amplify gains vs. holding during the times of the upward
market. Did quite well- it paid for itself in a month IIRC. Then the market
started going sideways & its limitations began to show. It doesn't work at all
anymore. I think the devs went out of business after pouring all their
resources into a newer version which had better strategies for the evolving
market. It's too bad, I was a big fan.

~~~
nadams
Some googling came up with this reddit thread [1] and a quote:

> It's a simple EMA crossover bot, don't buy this stuff. There's a chrome
> plugin that does the same for free.

Rhetorical questions to the comments:

What chrome plugin? Have you used it? Is it better/worse than Butter-bot?

Even other people in the reddit thread question why people aren't mentioning
the name of the open source project - what is this fight club rules?

[1]
[https://www.reddit.com/r/BitcoinMarkets/comments/1nc12p/has_...](https://www.reddit.com/r/BitcoinMarkets/comments/1nc12p/has_anyone_here_heard_of_or_used_this_butter_bot/)

------
sokoloff
If your starting stake is $10K (as in the story), you're wildly better off
taking any job, even programming on elance/odesk than working on algorithmic
trading...

~~~
jeffreyrogers
Yeah, that seemed bizarre to me. You'd need to have a huge edge (extremely
unlikely) to make money after fees with only $10k. Plus you're very limited in
what you can actually trade with that little capital. For example, many
options contracts trade for more than $10k.

~~~
gnaritas
10k is plenty, you're forgetting leverage; equities I think is generally
around 3x, futures usually offer around 10x leverage, forex in U.S. 50x, forex
outside of the US, 200x plus.

~~~
sokoloff
Calculate out what the projected hourly rate might be, after discounting the
gains on a broad-based index fund.

If you can get 30% annually instead of 10%, that extra 20% on $10K would be
$2000. If you worked just 200 hours in a year (seems a low estimate), that's a
$10/hr "job" and you have a non-trivial risk of a substantial drawdown during
the year that could put you near out of "business" (as happened in the
article).

Borrowing on margin, you're going to pay at least 7.5%, so if you're borrowing
to 3x, you're paying 15% on your account balance. (Small margin loans are
higher rate.) - [1]

Forex doesn't have the margin loan problem, but you can't generate much income
on a $10K yen/USD carry trade.

Round trip commissions will be a much higher drag on a $10K portfolio than a
$500K portfolio.

If you have the talent to develop an algorithmic trading system that can 3x
the market, you can make more than $10/hr in any number of easier and riskless
manners.

1 - [https://us.etrade.com/investing-trading/pricing-
rates#margin](https://us.etrade.com/investing-trading/pricing-rates#margin)

~~~
gnaritas
What it calculates per hour as a job has nothing to do with anything; you said
10k wasn't enough to overcome fees, that's absurd, 10k is plenty to invested
and get a healthy return from and far better than 30% annually, hell I made
35% last month and I didn't work an hour for it. Beat the market is a
meaningless scare tactic used by those that don't understand being small has
enormous advantages over being large and "the market" returns are what large
institutions struggle to beat, small traders destroy the market constantly
because being small is easier. Returns decrease as capital increases so it
doesn't scale up.

~~~
sokoloff
> What it calculates per hour as a job has nothing to do with anything; you
> said 10k wasn't enough to overcome fees, that's absurd

I agree that is absurd, but I said no such thing.

I don't think it's a sensible use of time, but of course you can beat just the
fees.

~~~
gnaritas
You said

> You'd need to have a huge edge (extremely unlikely) to make money after fees
> with only $10k.

No you don't. 10k is plenty to make money, equities aren't the only market and
paying the spread is trivial. Beyond that you're overestimating the time it
takes; what do I care how many CPU cycles my computer spends watching the
market? For a programmer, algo trading is trivially easy and a fun hobby so
that time isn't work anyway and it's only a few hundred lines of code to work
up a strategy, it's not exactly a big investment of time.

~~~
sokoloff
No, _I_ didn't say that. jeffreyrogers said that.

I said you were better off taking a side job and I still believe that to be
true from an economic point of view.

~~~
gnaritas
My bad on the mistaken identity.

Side jobs require my time, robots don't, they aren't comparable. I'm better
off working no side job and letting a robot earn money on the side because
that's simply better even if the bot earns less than I would on a side job.
Selling labor is not economically preferable to free money.

------
ConfuciusSay
The latest craze? I guess WSJ has been out to lunch for the past decade.

~~~
Trombone12
Knowing their track record on climate change...

------
onetimeusename
Algorithmic trading from home isn't new at all, it has been around for a
while. You can even buy backtesting and live trading software with a DSL that
makes it easier to do, e.g. Tradestation or Ninjatrader or as was mentioned,
InteractiveBroker provides solutions.

For the most part, people doing this are not on the scale of people doing HFT.
The net latency from home to market is much higher and the software lower
performance but I do know some people that have done it successfully. Their
bots trade anywhere from maybe dozens of times per day to once or twice per
week. It is a difficult business though.

~~~
vegabook
The primary activity of HFT and algorithmic traders is fundamentally
different. Whereas algos are trying to "beat the market", that is find alpha,
HFT is trying to "beat the market _makers_ ". They trade dozens of times every
second to find the liquidity distribution and arb the flows, not take
advantage of technically or fundamentally driven moves.

Needless to say HFT requires several orders of magnitude more resources than a
hobbyist algo trader, though there are also giant algos in hedge funds.

------
jakozaur
Request for startup: Make the AWS for algorithmic trading. Strategies are not
that hard, but it would be awesome if someone did hard infrastructure work and
provide nice API.

So the only thing you need to do is to upload some code and wire some money.

Bonus point for matching money. E.g. if you have your own system you can allow
to match your funds. So instead of $20k you can get additional $80k from other
investors. Likely it will be regulatory nightmare... but maybe there is some
legal workaround.

~~~
victorin
It already exists: [https://tradingmotion.com](https://tradingmotion.com)

There you'll find a marketplace of 3d party trading strategies ready to use
(once you pay the monthly fee that goes straight to the developer)

The API if you want to roll your own strategy is:
[https://sdk.tradingmotion.com](https://sdk.tradingmotion.com)

------
searine
Probably have better luck writing your own poker-bot.

~~~
cryoshon
I remember someone making a go at this circa 2006. Didn't work for whatever
reason.

Isn't gambling online illegal now?

~~~
Havoc
>Didn't work for whatever reason.

The online platforms check for it so its a cat & mouse game.

------
linux_devil
I did a course over coursera "Computational Investing" and tried building my
own trading model, but it's hard . you win some and loose some. Needs 100% of
effort as it can't be done in parallel with regular job . I need some
motivation here .

------
n0us
Alpha aside, someone learned the value of unit tests.

------
cygnus_a
What're your opinions on algorithmic swing trading based on fundamental
analysis / trends / other market measures?

------
kingnothing
Are there any free or cheap sources for historical stock data in a computer-
friendly format?

~~~
patio11
I do not endorse trading with it, but for many types of uses, you might take a
look at the Yahoo finance CSV "API." It has per-day resolution going back
about 15 years or so.

~~~
jwally
I'd take Yahoo's data with a grain of salt. Was tinkering with options prices
there, and the data wasn't clean which lead to a lot of false positives (e.g.
a lower strike call was selling for 1/2 of what a higher strike call sold
for).

Checkout TradeKing. You have to open an account to use it, but (to my
knowledge) you don't have to fund it.

------
jbob2000
So... anyone want to share some of these algorithms for predicting stock
prices?

~~~
gnaritas
You don't have to predict the market to trade, you need only follow the market
and ride the waves carefully. If the market is going up, buy, going down,
sell, you're betting that it'll continue in that direction. More than a few
people are rich off strategies as simple as buy when price breaks a 20 day
high and sell when price breaks a 20 day low.

~~~
dllthomas
_" More than a few people are rich off strategies as simple as buy when price
breaks a 20 day high and sell when price breaks a 20 day low."_

More than a few people are broke off such strategies, too.

While momentum strategies manifestly _can_ work out, there is no guarantee
that the "momentum" is actually present. As my econ prof put it, "The market
isn't going; it went."

~~~
gnaritas
> More than a few people are broke off such strategies, too.

Of course they are, it takes more than an entry strategy.

> While momentum strategies manifestly can work out, there is no guarantee
> that the "momentum" is actually present.

There doesn't need to be. Price moves up, down, or sideways, if it doesn't go
up/down as expected, get out and look for another opportunity or wait for the
market to move, it will move.

~~~
dllthomas
_" Of course they are, it takes more than an entry strategy."_

If all that is is their "entry strategy" then the strategy they are using is
more complicated, which runs counter to your earlier assertion.

 _" There doesn't need to be. Price moves up, down, or sideways, if it doesn't
go up/down as expected, get out and look for another opportunity or wait for
the market to move, it will move."_

It will move. But it needs to move in your favor more than against you, or
you're losing money. There's no particular reason to expect that to be
persistently the case.

~~~
gnaritas
> If all that is is their "entry strategy" then the strategy they are using is
> more complicated, which runs counter to your earlier assertion.

Not really, you need to have a position size strategy as well as an exit
strategy, all are fairly simple and only a few lines of code. Given a
bankroll, how much do you bet on any one trade (2% is trader standard, or if
you're really aggressive half kelly), and given an exit strategy, i.e. a stop
if you're wrong and an exit if you're right, just compute how much to trade
based on the amount you're willing to risk on the trade to the stop position.

So with a 10k roll, you place trades that will lose $200 bucks if you're wrong
and you let them ride until trend change hopefully netting $600 or more by the
time it's over, perhaps lots more depending on how long the trend runs. Once
that trade is safe, i.e. you're risk off, you start looking for another one
and you build up your position size without ever risking more than your
initial risk.

> It will move. But it needs to move in your favor more than against you, or
> you're losing money. There's no particular reason to expect that to be
> persistently the case.

Sure there is, markets aren't random, they trend persistently for longer than
they should if they were actually random. The EURUSD was on a 6 month long
downtrend this last year; that is not a random occurrence, that is a result of
long term economic trends. If you're selling breaks of a running low, you'd
have been shorting that all the way down; you need only adjust for volatility
so you don't get knocked out on normal sized retracements and ride the trend
down. You have to size your stops to adjust for normal volatility and allow
the trend to carry you to a win and you have to tune your entry so you're
already near an extreme against the trend so your odds are better, you can't
enter blindly, but it doesn't have to be dead on accurate if your stops are
wide enough. But wider stops require more capital to profit because you have
to stay in the market longer to see your profit point hit if you're keeping a
favorable risk to reward.

When the market isn't trending, don't trade it, you'll lose your ass in random
price movements.

------
facepalm
Math.random might do quite well?

------
chad_strategic
It's funny I didn't get an article about my algo, my returns aren't to
shabby...

[http://www.strategic-options.com/trade/](http://www.strategic-
options.com/trade/)

~~~
et2o
I think you would be more successful at attracting attention if you fixed your
website.

