Live data from Hacker News

Introduction to Zipline: A Trading Library for Python

quantinsti.com

91–100 of 155 posts

Re: Introduction to Zipline: A Trading Library for Python

#91

For the past year I have been trying to learn more about trading, risk management, etc. There are so many stories about how the markets work and how to make money in them. You could spend your lifetime throwing money down a hole trying each one and probably do worse than random. I can't say enough good things about the perspective I have gained from just listening to good interviews of people that trade and manage fu…

Have you read Market Wizards by Jack Schwager? Fantastic book and it really goes deep with how these traders think about approaching and exiting a trade/market.

The problem is it's all hogwash due to survivorship bias; every single one of them could simply be lucky. This is literally no different than interviewing lottery winners and asking them how they chose their numbers. People who write books about the successful are conning you for cash, always. There is nothing to be learned from the habits of just successful people; other than misleading yourself with superstition.

Re: Introduction to Zipline: A Trading Library for Python

#92

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…

As long as the target you're optimizing for is different than what those 100 of PhD's (and most of the market) are optimizing for then maybe you've got a chance. You also don't need to pay their salary.

So I agree wrt/ to longer time periods. Most of those PhD's are probably trying to predict minute to minute moves, or daily moves. A lot of them would be out of a job if they lose over 90 day periods.

Not sure how much of an edge can be gained over buying and holding some reasonably diverse equity portfolio. If anyone is thinking they'll beat some HFT hedge fund they're almost certainly not going to. If they're thinking of beating a reasonably diverse/optimized portfolio over longer terms that's maybe possible IMO but the difference isn't going to be huge. To amplify the difference requires taking on more risk, for example by leveraging, options etc.

If I want to decide whether long term investing in the US vs. Turkey, Greece, Brazil, Russia, or the UK, or gold :) it's not clear machine learning can give me useful insight. The historical data has its limits. Predicting geo-political processes and things like interest rates for the long term seems like a very difficult problem. I would suspect the machine answer to this question would be something like P/E is lower so it's a good investment but who knows. So I agree with the economic/market insight comment as well.

Re: Introduction to Zipline: A Trading Library for Python

#93

Earlier quoted context omitted.

You're right, I would primarily like to see them more liquid so that there were more data points to extrapolate moves across different asset classes

What you really want is more transparent data. There are plenty of data points but they are not easily accessible.

and I think the lack of this perpetuates market inefficiencies. I think insights into CDS can be a leading indicator into equities and equity futures, yet CDS are restricted to OTC markets in the US

anyway, I'm sure this is its own discussion

Re: Introduction to Zipline: A Trading Library for Python

#94
As a veteran of one algo shop, I have this to say:

Play with the data all you like. Don't try to trade on it if you don't really know what you're doing. (Or, just recklessly trade other people's money. It's fun.)

What you're seeing here is the "napsterization of finance." (Google it, it will lead you to the article I am almost plagiarizing).

Basically, the market at large puts together a pot of money (called "alpha", debatably) The better you are at trading, the more of that pot you get.

BUT this is not a zero sum game. It's worse.

If the markets are functioning properly, then the better you are a this, the bigger the share of the pot you get, AND the smaller the pot of money gets.

It used to be that middlemen like the NYSE stock market specialists made very large amounts of money doing what Homer Simpson automated with a drinky bird. Now, the also shops have already shrunk that pot considerably. Good news for your pension fund. Bad news for you if you try this yourself. So don't.

Re: Introduction to Zipline: A Trading Library for Python

#95
post #71

Earlier quoted context omitted.

This has been on my mind recently as someone who was in the front office for a few years (but not making trades) but is now on the outside. I mean each day 100's of Phd's start with clean market data, more data sources than you could possibly think of and statistical back testing systems that have 1000's of man hours put into them, trying to find a way to make money. It seems to me that the Tiger Rule applies here. Y…

Don't think in terms of there being one tiger that stops as soon as it gets something to eat. The market's more like a sea full of countless sharks, where all the sharks have to survive by eating other sharks. You're not wrong to think that, if there's any way to consistently make money by trading, it's by exploiting inefficiencies in the market. But remember that those inefficiencies come from people. Are you confid…

Why is it efficient for gains in the market to be won by only a few actors?

Re: Introduction to Zipline: A Trading Library for Python

#96

Earlier quoted context omitted.

Don't think in terms of there being one tiger that stops as soon as it gets something to eat. The market's more like a sea full of countless sharks, where all the sharks have to survive by eating other sharks. You're not wrong to think that, if there's any way to consistently make money by trading, it's by exploiting inefficiencies in the market. But remember that those inefficiencies come from people. Are you confid…

Why is it efficient for gains in the market to be won by only a few actors?

Why do you think you deserve any of the gains?

Re: Introduction to Zipline: A Trading Library for Python

#97
post #84

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…

The rapid rise in popularity of algorithmic trading among everyday coders, the massive growth of /r/wallstreetbets, and the popularity of Quantopian tells me one thing: Go long on retail brokers (AMTD, ETFC, IBKR)

That was my first thought. If I had the resources, I'd built up that subreddit. Youtube videos. HN posts. Some trading libraries on Github. Some forums. Promotional deals to start out.

Previously there were other pyramid schemes, penny stocks, FX trading forums and so on. As those went out of fashion there is a new cohort of young people with great imagination who think they can beat the stock market. Some surely see a great potential there ready to exploit. They'd be silly not to.

Or to put it more obviously when everyone goes digging for goal, don't follow them, but start selling shovels. Then maybe take some profits and put some ads out in the saloons with stories about awesome finds of massive amounts of gold.

Re: Introduction to Zipline: A Trading Library for Python

#98
post #87

Earlier quoted context omitted.

This level of defeatism is the exact reason I got into the markets algo trading. People like you stay out. More to the point, just because a genius mathematician and code breaker started a hedge fund it doesn't at all push out any of the little guys. The market is so large he can't possibly be trading all instruments at once, and "scaling" is a problem for huge hedge funds. Especially ones that have to answer to thei…

In fairness, if someone told me they were going to make a killing on free webmail supported by ads and data mining, I think "How on earth do you intend to complete with Google?" would be a perfectly legitimate question.

In fairness, by that logic nothing would ever get done. Microsoft? You're never going to win over IBM. Xerox? You'll always be ancillary to Kodak. GM? Ford is already there. The Fugger's Banking company? Good luck against the Venetians and the Florentines. Same old story. At the end of the day, you either try something new or you don't.

Re: Introduction to Zipline: A Trading Library for Python

#99

Earlier quoted context omitted.

Don't think in terms of there being one tiger that stops as soon as it gets something to eat. The market's more like a sea full of countless sharks, where all the sharks have to survive by eating other sharks. You're not wrong to think that, if there's any way to consistently make money by trading, it's by exploiting inefficiencies in the market. But remember that those inefficiencies come from people. Are you confid…

Why is it efficient for gains in the market to be won by only a few actors?

You're using the word "efficient" in a different sense from what it means in the phrase "efficient market".

Re: Introduction to Zipline: A Trading Library for Python

#100
Hi, a shameless plug: I went to the Quantopian (the company that is behind Zipline and essentially uses Zipline as the core backend to their cloud platform) algo-trading hackathon two weekends ago and came up with this algo:

https://www.quantopian.com/posts/xiv-slash-vxx-pair-trade-1

Pair-trading VXX and XIV based on the StockTwits sentiments of the SPY at market open. The backtest did really well from 2011 to 2014 with 1700-1800% return in 3 years; and flat between 2014 to present-time,

I'd really love it if people can improve upon the algo and see what people when they clone the algo and come up with ways to mitigate the drawdown's and improve the performance!

Post reply on HN