Live data from Hacker News

Python For Finance: Algorithmic Trading

medium.com

151–160 of 164 posts

Re: Python For Finance: Algorithmic Trading

#151
post #58

Earlier quoted context omitted.

Even if it's a zero sum game (which it's not), most participants are not quant/algo based. As long as you can beat 50% percentile, you can make a profit. Sure you may not be as profitable as top quant companies, but do you really mind that much?

Trading is a zero sum game. You are making nothing. You win, someone else loses.

Trading is not a zero sum game. It doesn't matter if nothing's being made, that's not the point. It's an important service providing pricing and liquidity which facilitates capital allocation, diversification, and risk management. Trading is an absolutely essential part of the economy.

As a simple example, a farmer hedges his wheat crop selling wheat futures. That allows him to reduce some of his risk, thereby allowing him to plant more (i.e. growing the economy). The market marker who bought the wheat futures may be trading multiple commodities. This trade diversifies his risk, allowing him to trade more of other commodities, allowing other farmers to offset more of their risks (i.e. growing the economy). Investment companies or hedge funds enter the market purchasing futures, to diversify their risks, allowing them to invest more in equity markets, which fund companies (i.e. growing the economy).

If my point isn't already clear, markets and trading facilitate the diversification and allocation of risk capital to market participants thereby growing the economy. It's the conduit for capital which does make something.

Re: Python For Finance: Algorithmic Trading

#152
post #99

Earlier quoted context omitted.

> Oh... HUGE difference. What percentage of the portfolio is the position? How long have you run this strategy; I ask because those are huge returns that indicate to me you're taking huge risk which can work short term but nearly always wipes you out over a sufficient amount of time. No single position can be more than 10% of the portfolio, there is no limit on concurrent positions, and the strategy cannot use more t…

What platform are you using? Do you pay for each trade?

I use Interactive Brokers (the Python TWS API), with a trading system I've written in mostly Python and C++. Yes, I'm charged per trade (occasionally there are rebates, but the strategy doesn't optimize for adding liquidity). I don't have the trading volume to negotiate flat commission rates (nor is that really high on my list of priorities).

Re: Python For Finance: Algorithmic Trading

#153
post #138
post #135

Earlier quoted context omitted.

> Can you provide sources that back up your claim with studies of inefficiency of technical analysis? Not the original guy but I just want to point out that Warren Buffett, Peter Lynch do not believe in technical analysis.

Well they are obviously fundamental type of investors, and I have no doubts this type of investment is superior to pattern matching and chart gazing. But I see all those guys doing their pretty technical analysis charts in stocks and bitcoins and even though I think it's all BS, I wonder, is it? I mean, can you get a small edge? why would they be at it all day if it wasn't making them money?

> I mean, can you get a small edge? why would they be at it all day if it wasn't making them money?

It's gambling, they win randomly and falsely attribute the wins to tech analysis and dismiss all the losses as them "reading" it wrong. The random wins attribute to an addiction and superstition but they'd win just as much flipping a coin to decide whether to buy or sell. These people are very bad at math, if they were any good they'd be doing quantitative analysis and looking for actual patterns in the data that stand up to real scientific inquiry. Technical analysis is to quantitative analysis what alternative medicine is to actual medicine.

Re: Python For Finance: Algorithmic Trading

#154

Earlier quoted context omitted.

> Passive investing using index funds is definitely not sexy, but it gets the job done. Only if you have a significant amount of capital to play with. People looking into active trading are doing it because they don't have the necessary capital to make passive investing meaningful; they're looking for much much larger returns that you can get from an index fund, which necessarily comes with more risk. Traders are gam…

This is extremely reckless investment advice. Active trading, by definition, incurs higher transaction costs than passive investing. Since transaction costs are generally priced per trade, active trading is more costly on a percentage basis for individuals with less capital.

> This is extremely reckless investment advice.

It wasn't investment advice, nor did I say it was a good idea; I'm merely telling you why people choose active investing: they believe they can do better and there's enough stories out there of the "lucky" person who did better to keep that hope alive. In all likelihood they're going to lose their money, but you'll never convince people trying to win a lottery that they're better off accepting they can't. I literally said traders are gamblers, obviously that means I think active trading is gambling, that's not investment advice.

Re: Python For Finance: Algorithmic Trading

#155
post #49
post #45

The main issue I found in algo and financial aspects of programming is that the market is a zero sum game, and my intro knowledge of finance and algorithms, even when I know python, are no match for MIT PHD Quants who does it full time. There's no real way to compete with that, and therefore I would lose money, even if the data showed it might be successful in the future, firms and full time workers on algo trading w…

I agree with most of what you're saying in principle, but it is very possible to identify alpha or acquire an edge that institutional market participants don't have. If you have access to data that most of the market does not, you can effectively trade on it. You can also effectively trade on a novel insight on a combination of data sources. There is a lot of information asymmetry, and an individual is capable of cap…

> If you have access to data that most of the market does not, you can effectively trade on it.

Yes, but you aren't going to have any such data. If the information is available to you, it's available to other participants of the market as well and you're not the only one trading on it.

Re: Python For Finance: Algorithmic Trading

#156
post #49

Earlier quoted context omitted.

I agree with most of what you're saying in principle, but it is very possible to identify alpha or acquire an edge that institutional market participants don't have. If you have access to data that most of the market does not, you can effectively trade on it. You can also effectively trade on a novel insight on a combination of data sources. There is a lot of information asymmetry, and an individual is capable of cap…

> If you have access to data that most of the market does not, you can effectively trade on it. Yes, but you aren't going to have any such data. If the information is available to you, it's available to other participants of the market as well and you're not the only one trading on it.

I used to believe that as well. But it's fully possible to have data no one else does if you source it yourself (and I do). Furthermore, it's alright if a small number of other participants have the data as long as it's not yet priced in to market consensus.

Re: Python For Finance: Algorithmic Trading

#157
post #156

Earlier quoted context omitted.

> If you have access to data that most of the market does not, you can effectively trade on it. Yes, but you aren't going to have any such data. If the information is available to you, it's available to other participants of the market as well and you're not the only one trading on it.

I used to believe that as well. But it's fully possible to have data no one else does if you source it yourself (and I do). Furthermore, it's alright if a small number of other participants have the data as long as it's not yet priced in to market consensus.

If you can source it, so can others, what makes you think only you have thought about trading on that data which must necessarily be public for you to have it legally?

Re: Python For Finance: Algorithmic Trading

#158
post #156

Earlier quoted context omitted.

I used to believe that as well. But it's fully possible to have data no one else does if you source it yourself (and I do). Furthermore, it's alright if a small number of other participants have the data as long as it's not yet priced in to market consensus.

If you can source it, so can others, what makes you think only you have thought about trading on that data which must necessarily be public for you to have it legally?

> If you can source it, so can others

Yes, agreed: the longer the data is available, the more likely it is that others catch and start using it. That's a constant battle of course - continually coming up with new sources of data and new ways of getting it before most of the market.

> what makes you think only you have thought about trading on that data which must necessarily be public for you to have it legally?

I don't think I'm the only one who has thought about trading on it; on the contrary, I know there are many parties interested in trading on material information that is only technically public, but very obscure. However, after consistently profiting on this data, I can be fairly well assured that there are relatively few parties with the same informational edge, because the market consensus clearly doesn't price it in until it becomes explicitly widely known.

As I said, I don't need to have certainty that I am literally the only party with the information, so long as it is known by so few parties that the market consensus doesn't price in the sentiment. All material data has a half-life, which decays with time and market awareness. In some cases, the nature of the data or the methodology for sourcing it is so novel that it is conceivable to be the sole party with the information for a short and meaningful time period (where information means the exact same dataset acquired in a categorically similar way, not the downstream sentiment derived from the dataset). But that is a much higher bar, and it's completely unnecessary for profit. It's nice for pride though.

You'll have to forgive me for not going into any greater detail than that, both because any more than this is strictly a trade secret, and because I'd rather not have a competitor for my personal trading operations (or have someone turn around and sell this data, ruining my alpha in the process). The best I can tell you is to look into the analysis of satellite imagery, but with greater human ingenuity and a more specialized approach. That's not going to get you all the way there, but at least that much of the methodology is publicly known thanks to the old article about Walmart parking lots. You can't collect actual information about a company, but there is a lot of room for human creativity in finding strong proxies for that data that the rest of the market is mostly ignoring.

Re: Python For Finance: Algorithmic Trading

#159
post #81

Earlier quoted context omitted.

An economist and a normal person are walking down the street together. The normal person says “Hey, look, there’s a $20 bill on the sidewalk!” The economist replies by saying “That’s impossible- if it were really a $20 bill, it would have been picked up by now.”

This quiq seems to support the original posters thesis, though, no? No one's going to make a living wandering the streets in search of $20 bills.

Well it's a theoretical economics concept. The $20 bill is an opportunity, nothing more. A pretty good deal of course, but if you are pedantic you could defend the standpoint that you did have to do something to get it: first, get lucky enough to be there, notice it, then bend over and maybe clean it. So it's not "free", just a pretty good deal.

The same thing applies to getting a job for instance. Take job X. If job X was available and worth doing at wage $, someone would be doing it. So why bother applying ?

So what it really means is that the semi-strong and strong form of the efficient market hypothesis is bullshit: there are plenty of opportunities in the market, you're just not seeing most of them.

I would argue that nearly everyone doesn't even try to see opportunities.

Re: Python For Finance: Algorithmic Trading

#160
post #61
post #48

Earlier quoted context omitted.

If the market is a zero sum game, then for every winning trade, there must be a losing trade. Obviously some teams must be winning consistently, which implies that some are losing consistently. This says that the consistent losers go out of business. So who are the winners going to trade with? By contradiction, it is not zero sum.

> Obviously some teams must be winning consistently, which implies that some are losing consistently. That does not necessarily follow; markets are not static and players are free to enter and leave.

Not quite. You need money to enter. Which was the parent poster's point - eventually, the losers will all be gone and there will be nobody left to trade with.
Post reply on HN