Live data from Hacker News

Introduction to Zipline: A Trading Library for Python

quantinsti.com

21–30 of 155 posts

Re: Introduction to Zipline: A Trading Library for Python

#21

Everybody's trading nowadays. How about just investing :-) I.e. focus on periods longer than a year, which so few people/professional market participants do. And on actual businesses instead of the crazy antics of a line. I wonder if you could use something like Zipline/Quantopian to screen huge amounts of consolidated balance sheets for markers of undervaluation. You could reject 1000s of companies and focus your “m…

Actually, does anyone know where an amateur could buy/download quarterly balance sheets/income statements for the broad stock market universe?

Re: Introduction to Zipline: A Trading Library for Python

#22

I've typed and deleted this post a few times trying to find a way that it doesn't sound kind of pompous but if it helps save one person alot of money then screw it, I'll sound pompous.... I get asked quite a bit on how to start doing algorithmic trading and the first thing I always tell people is don't. I think I've said this many times now but the number of people who come at it with the thinking "I'm a computer sci…

I never understood this. If its possible to be a profitable independent day trader, and we know it is because many are, then it should be possible to code the rules you follow and become a profitable algo trader.

Leaving aside the question of how many profitable day traders there actually are, there are profitable professional poker players out there but no bot can compete with them. Now scale up the complexity of poker by at least an order of magnitude and you end up with the financial markets.

Sure, it is possible to to program very niche behaviour, but we are nowhere near any sort of program that can act as general "day trader".

Re: Introduction to Zipline: A Trading Library for Python

#23

Everybody's trading nowadays. How about just investing :-) I.e. focus on periods longer than a year, which so few people/professional market participants do. And on actual businesses instead of the crazy antics of a line. I wonder if you could use something like Zipline/Quantopian to screen huge amounts of consolidated balance sheets for markers of undervaluation. You could reject 1000s of companies and focus your “m…

Actually, does anyone know where an amateur could buy/download quarterly balance sheets/income statements for the broad stock market universe?

Most professionals I've known use Capital IQ, which is expensive.

It's surprisingly tough to get broad, machine-readable market data for free but there are some cheaper options. Check this thread: https://www.reddit.com/r/SecurityAnalysis/comments/2ci5du/ca...

Or you could always scrape Yahoo Finance :)

Re: Introduction to Zipline: A Trading Library for Python

#24

Everybody's trading nowadays. How about just investing :-) I.e. focus on periods longer than a year, which so few people/professional market participants do. And on actual businesses instead of the crazy antics of a line. I wonder if you could use something like Zipline/Quantopian to screen huge amounts of consolidated balance sheets for markers of undervaluation. You could reject 1000s of companies and focus your “m…

Actually, does anyone know where an amateur could buy/download quarterly balance sheets/income statements for the broad stock market universe?

All US public company quarterly financial reports (and much more) are available in raw form at the SEC EDGAR site (https://www.sec.gov/edgar/searchedgar/companysearch.html). Those reports income statements, balance sheets, etc. But beware that companies will often file corrections later.

In addition, nearly all finance sites provide summaries of these reports for at least the last few quarters and last few annual reports. I like morningstar.com. But finance.yahoo.com and finance.google.com both work fine.

If you want a bunch in one shot and don't have the money for Bloomberg or CapitalIQ or whatever, I suggest quandl.com, which acts as a cut-rate data aggregator for financial data.

Re: Introduction to Zipline: A Trading Library for Python

#25
I basically implemented this, and a lot of other features for my own personal trading bot against the Cryptsy API written in Python. The idea was to makes tons of small trades on alt coins throughout the day, constantly buying and selling on short crossovers, making fractions of a perfect profit after fees. It turns into an up and down roller coaster, sometimes you're way ahead, and other times you lose it all. The biggest issue was the low volume on most of the alt coins. At the end of the day, like many others have said, it's mostly luck, you will lose money eventually,but it's an interesting learning exercise. The only real way to win, is to have some insight into the market, not machines.

Re: Introduction to Zipline: A Trading Library for Python

#26

I've typed and deleted this post a few times trying to find a way that it doesn't sound kind of pompous but if it helps save one person alot of money then screw it, I'll sound pompous.... I get asked quite a bit on how to start doing algorithmic trading and the first thing I always tell people is don't. I think I've said this many times now but the number of people who come at it with the thinking "I'm a computer sci…

I mostly agree with this. Treating markets as an exercise purely in data science is a _bad idea_. Risking money without a solid understanding of market mechanics and trading conventions is a recipe for disaster. Taking a Bayesian view won't save you either - this is a land where some new "six sigma" event happens every six months.

That said, the same logic that holds for identifying profitable strategies within an institution holds for individuals: unless you have better gear, don't fish a crowded pond. As an individual, your small size is, in some regards, an advantage. Institutions routinely pass on strategies that don't have capacity (there's not enough liquidity to make the strategy's returns worthwhile relative to their trading level) or strategies that aren't quite up to their standards (but might be up to yours). There's also a huge class of strategies that have somewhat choppy but long run consistent returns. Traders and funds worried about MoM track records won't touch those.

Fees are the biggest barrier to entry. Institutions enjoy substantial discounts and an ability to amortize costs across a much wider base, making the strategy performance hurdle rate proportionally higher for smaller traders.

Re: Introduction to Zipline: A Trading Library for Python

#27

I've typed and deleted this post a few times trying to find a way that it doesn't sound kind of pompous but if it helps save one person alot of money then screw it, I'll sound pompous.... I get asked quite a bit on how to start doing algorithmic trading and the first thing I always tell people is don't. I think I've said this many times now but the number of people who come at it with the thinking "I'm a computer sci…

I never understood this. If its possible to be a profitable independent day trader, and we know it is because many are, then it should be possible to code the rules you follow and become a profitable algo trader.

The comments here are interesting...Looking at your question from a different angle, yes, of course it's possible to be a profitable algo trader - set your first investment to buy("SPY") and do nothing else for 20 years. What you are asking though depends entirely on your risk tolerance and what you are benchmarking your strategy against.

Re: Introduction to Zipline: A Trading Library for Python

#29
post #11

Earlier quoted context omitted.

I don't know anything about algorithmic trading, but I'm just wondering, are the people who do make money lots of money out of it, those who have servers close to the data source, who do high frequency trades.

You can make money having by having better access like the HFT firms or by having data not widely available. You can also make money by applying well known principles more intelligently than others. This latter approach usually requires a lot of money. You can't afford retail brokerage costs when you're in a highly crowded and competitive trade. The best way to make some money as a personal trader is to take advantag…

> You can't afford retail brokerage costs when you're in a highly crowded and competitive trade.

This is very important. Most brokerage charge around $7 per trade, which makes high-volume trading very very expensive and prohibitive.

Robin Hood is an amazing alternative that charges nada for trades, and once they have an API[1], I think they'd be a great choice for small-time developers looking to do some (low-frequency) algorithmic trading.

[1] https://support.robinhood.com/hc/en-us/articles/210216823-Ro...

Re: Introduction to Zipline: A Trading Library for Python

#30
I have looked at Zipline before, but it does not handle intraday trades, and does some guesses on when the trade executes during the "day", so you may not get the best price.

Running an algorithm for multi-day trades for more than a few months does not make sense on how the markets move, as certain events like "brexit", earnings, M&A, etc... affect stock price.

If you are really interested in algorithmic trading, and you have programming experience, it's best to build your own backtesting system with intraday market data (pay for this).

This way you will know the ins and outs of a trading system.

Post reply on HN