12 ms·
Offline Algorithms in Low-Frequency Trading
- lowfreqtrader 6y agoIf low frequency trading interests you, here's a project some people might want to check out: https://github.com/brndnmtthws/thetagang https://github.com/brndnmtthws/thetagang It's designed to sell option premium on major indices (like the S&P500 or NASDAQ-100) to generate mostly passive income, with a fairly reasonable risk-adjusted return. It uses a combination of strategies that involve selling naked puts and covered calls, which both have the same risk profile, but naked puts tend to have higher premiums.
- hntrader 6y agoWhat does the tail risk look like on this strategy and what kind of annual return do you expect?
- omarhaneef 6y agoYou’re taking the tail risk on the down side but you’ve sold it on the upside for extra yield.
- artemonster 6y agoI undestand words but I have absolutely no clue what you're talking about. Can you recommend some books on the topic?
- rusticpenn 6y agoYes, me too. I just read about someone calle 1ronyman on Reddit, and I am interested too.
- im3w1l 6y agoThe "tail" in tail risk referes to the tails of a probability distribution. A normal distribution has "thin" tails. The probability of huge outliers is pretty low. If you have tail risk, then it means you have a decent chance of losing a lot more money than the typical variation. Your returns might look like +1.1, +0.9, +1.2 +1.05, -3. So your profit is pretty predictable with little variation, until suddenly you lose a lot of money.
- omarhaneef 6y agoI would look up two terms: Covered calls Naked puts If you want to go heavy duty into it I recommend the Hull book (options, futures and other derivatives) but for your purposes the investopedia articles are enough. Basically naked puts means you’re selling downside insurance so if the stock crashes you eat the loss. Covered calls mean you sell upside risk but have the stock so if it goes up you make a little.
- beezle 6y agoHull is a great book and is not too heavy on the math. However, for someone just getting their feet wet, Options as a Strategic Investment by MacMillan is a classic.
- wbl 6y agoThe only book you should read is John Bogel's. Do what he says like Goldman partners, Bank of America senior executives, almost every economist does with their money and stick it in low cost diversified mutual funds. Or you can learn stochastic calculus and end up in the same place once you realize half of all active traders do worse than the market, before fees.
- joshribakoff 6y agoBuffet sells 5b in options premium a year
- atomicnumber3 6y agoI think a big distinction that retail traders need to come to terms with is that, while yes, technically you can make reasonably good sums of money with various trading strategies of various risk profiles, as one person, so many of them are just not worth the trouble. If your passion is this sort of thing, by all means, go ahead. But it's like running a homelab. Yes, you can get pretty decent "savings" (vs running in AWS/DO) but I can guarantee you, you will end up in the basement replugging ethernet cables trying to figure out which one is the bad one while your family and relatives are waiting upstairs, fairly bemused, for you to fix "the internet". It's possible, but as a person with a life, unless it's your passion, I'd recommend just not. Do the financial equivalent of paying DigitalOcean 5 dollars a month: buy sp500 etfs and sit on them.
- hntrader 6y agoI wonder if we can invest in a fund manager who does this strategy. And if it's so good then why do pension funds and endowments not allocate to it typically.
- smabie 6y agoNone of the kinds of people you listed are good at trading (esp economists). From experience, professional traders do tend to use passive indices for part of their PA, but also actively trade a portion. But you're right in that if you don't have a passion for it, you'll never be able to truly outperform spy on a risk adjusted basis. However, if you do have the knowledge and the passion, I definitely think you can. Investing is personal, and just holding spy doesn't fulfill everyone's objectives. Here's an example of a strategy that outperforms spy in most cases: 1/3 of your portfolio goes to upro (3x leveraged spy) and 2/3s goes to a bond fund/etf. As long as the bond etf returns above the upro expense ratio (~1%), you will outperform. From my backtests, this strategy will earn you an extra 1-2% return a year, while also having a slightly higher risk adjusted returns. I list the above as a great example because it's the kind of strategy that is great for a PA: easy to manage, doesn't require babysitting, and backed by solid academic research. When people think active vs passive, they think actively trading single stocks vs just holding an index. My point is that you can use some quant-lite strategies that tilt your portfolio to eek out a little return. You don't have to be trading everyday or even holding anything except ETFs.
- im3w1l 6y agoSelling a deep in the money put behaves like owning the stock (probably with margin, but it depends on how many puts you are selling compared to your reserves of cash and short term "safe" bonds) except that you are capping your gains. The further towards out of the money you go the more it behaves like picking up pennies in front of a steamroller. But an interesting quirk of selling puts compared to calls is that the downside is limited. The stock can't go below 0.
- hntrader 6y agoThat gives me a good intuitive picture. I'd really love a basic online simulator where I can plug in portfolio characteristics (eg percent of calls Vs puts, ATM Vs OTM) and simulate an equity curve over the last ten years. I could build my own of course but I think a tool like this would be generally useful for investors.
- Schweigi 6y agoI did make my own option trading algo which is similar to the one in the Git Hub repo (but I used Scala, which gave me additional returns, jk :) ). Return totally depends on the delta of the options you write and the option symbols in your basket. Mine could be configured to be between 10-100+%. The higher the return the more volatile. The idea of using multiple symbols like SPY and TLT is to reduce the tail risk. But in the end there is still tail risk like for example in the crash of 2015. Making the strategy delta neutral with hedging could improve it but I never completed that part. There is an interesting book with all the math by Euan Sinclair about option writing and how to minimize the risk if you are interested.
- hannofcart 6y agoAnother way to reduce tail risk when selling options is to simply hedge with a protective call/put at a higher or lower strike respectively. Sufficiently far off strikes will have minimal impacts on returns while reducing tail risk.
- scruple 6y agoThese are known as a Poor Man's Covered Calls and Poor Man's Covered Puts.
- kgwgk 6y agohttps://www.daytrading.com/selling-volatility https://www.daytrading.com/selling-volatility
- WJW 6y agoThere's a fantastic quote in the book about the LTCM fiasco ("When genius failed") about how academics always want to short volatility because they have view of how society "should be" and it is not very volatile. IIRC, the quote was by some old grizzled options trader who used to have the same view but had been bitten often enough to internalize that volatility is much more common than beginners think.
- RyanShook 6y agoHave you been successful running this script/strategy?
- jkhdigital 6y agoI’ve observed the opposite in cryptocurrency option markets; covered calls tend to net a higher yield than the equivalent puts.
- lionyo 6y agoWhere are you writing your options? Only the stablecoin pairs seem to be liquid
- nullc 6y agoThat is the normal behaviour for commodities. It's arguably reasonable that Bitcoin behaves more like a commodity than a stock, at least so far as anything is arguably reasonable in the realm of cryptocurrency. But maybe strategies involving puts will become more successful if we can convince more of the HN Bitcoin naysayers to sign up for LedgerX and put their money where their mouth is. :)
- lordnacho 6y agoEx pro options trader here. Looks interesting, and I've starred it, but it does sound like it's just collecting premium? If you're selling options, you probably need to risk adjust your returns a bit more than what's common: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260 That's by Andrew Lo, big name in the area. I'm sure you've also come across Taleb, who knows a thing or two about selling options.
- Goosee 6y agoSSRN only let me view the abstract. Here's a link to the pdf that worked for me. https://alo.mit.edu/wp-content/uploads/2017/06/The-Statistics-of-Sharpe-Ratios.pdf https://alo.mit.edu/wp-content/uploads/2017/06/The-Statistic...
- JimBlackwood 6y agoDo you maybe have some books you could recommend? I have a strong math background, so that’s not a problem. I have a hard time finding courses or books that cover how these instruments work in some depth.
- lordnacho 6y agoThe problem is the books don't really tell you. They're written in this mathematical way that kinda obscures how to actually think about them practically. If you're more into math maybe stochastic calc will be just fine for you. Here we go anyway: Hull: Futures, Options, and Other Derivatives Natenberg. Don't recall the name, but this is maybe the closest to practical. Paul Wilmott, Quantitative finance. Taleb, Dynamic Hedging. Got a signed copy :) Also I think it's smart to read about instruments that aren't options, ie don't just cut to the chase. Time value of money, futures, forwards, bonds, swaps, equities. Then vanilla options on all those things, then exotics.
- pvitz 6y agoSomeone with a strong math background should cut Wilmott and go directly to Shreve: Stochastic Calculus for Finance II (or Björk: Arbitrage Theory in Continuous Time).
- beezle 6y agoGenerally speaking, a seller of naked puts is looking to supplement income via a stock they are willing to own at a lower level. If you are not willing to take delivery, it is probably better to sell a vertical spread so that there is a built in stop out. Here I'm speaking of transactions of a reasonable premium amount, not 5 or 10 cents. While it is true that the upside is unlimited against a naked call (and the downside is 0 on a naked put), naked puts suffer from systemic risk that calls for all intents do not. Both are subject to news/events specific to the company in question, but the risk of the short call running away from you because the market had a +20% day are well, fleeting. On the other hand, unexpected economic news, politcal/military events, liquidity issues, etc can tank the entire market 10, 20, 30% and have numerous times. A rise of similar magnitude, to my knowledge, has only happened after market crashes (so you would then be alert to the upside risk).
- deleted 6y ago[deleted]
- qeternity 6y agoThis is why skew exists, and should not deter anyone. The vast majority of people should buy a 20-30% dip, and so the fact that 99% of the time you're not going to be assigned means that it's a good idea in most scenarios. I suggest most retail to be short straddles against a core underlying position for yield enhancement. Yes, over a number of decades you will have something go against you, but under the current monetary and fiscal regimes, you should be hoping for the day that you can buy the dip or sell the rip via a systemic short vol overlay.
- kgwgk 6y ago> The vast majority of people should buy a 20-30% dip, and so the fact that 99% of the time you're not going to be assigned means that it's a good idea in most scenarios. So "people should buy a 20-30% dip" but should not be invested already? Because if they are, selling puts may not be a good idea.
- beezle 6y ago
- svmt 6y agoI briefly looked at the README and code. The strategy is an implementation of The Wheel. Did you backtest the strategy including commissions? I doubt there is much left after commissions. See [0] for a backtest including commissions and [1] for a blog post from ORATS on how to backtest the strategy using the ORATS backtester. [0] https://www.reddit.com/r/options/comments/j3ofna/the_wheel_backtested/ https://www.reddit.com/r/options/comments/j3ofna/the_wheel_b... [1] https://blog.orats.com/backtest-basics-how-to-set-up-the-wheel-strategy https://blog.orats.com/backtest-basics-how-to-set-up-the-whe...
- opportune 6y agoWhat many people don't understand about the relatively low-risk options strategies like the wheel or basic covered call selling is that, because they are low risk, they are less lucrative than many simpler strategies. The financial industry would not just leave that much risk-adjusted return on the table, after all. Just because a strategy is complex does not mean it is lucrative.
- jmcqk6 6y agoI think you must mean that covered calls or the wheel are less lucrative than more complex strategies, unless I'm really missing something. Can't get much simpler than a CC. The Wheel as a strategy doesn't scale well, though. A good stock for the wheel has relatively low volatility, but with high volume of option interest. These two things are kind of opposed to each other, though. If a stock isn't very volatile, then there isn't much need for large option interest. Of course there is a lot of overlap where things get interesting. I think the reason why there aren't a lot of institutions running the wheel et. large. is because it just can't work at the scale they want to operate on. You can probably run the wheel pretty successfully at a million in capital (much larger than I'm used to), but at 10, 100, or 1 billion, it just doesn't work. And what are they going to do? Pay some guy 200K to generate maybe 200K on a million in capital?
- opportune 6y agoWhat I mean is that wheeling on SPY is less lucrative than even buying and holding SPY over time, because they are lower risk; see the linked post with backtesting. The past year is not a great example because we have had periods of higher-than-normal volatility. Of course, you might have better luck wheeling on something with much more implied risk than SPY or cycling through some of the most risky stocks. But depending on where you are in the wheel, you are still yourself assuming risk that can make you lose money (e.g. a collapse in implied risk while you hold the stock). When you say wheeling works best on a stock with low volatility and high OI, what you mean is that it works best on a security with under-priced risk. I am sure there are actually many funds running strategies based on exploiting over-priced risk premiums. They just have no need to trade options on the open market since they can work with a market maker who can take the other side for them.
- icedchai 6y agoSeems like it would be less trouble to buy QYLD (nasdaq-100 covered call ETF), or one of the equivalent funds.
- varyherb 6y agoGenuine question, does this strike others as immensely off-topic? I'm curious if the parent commenter even opened the link. I'm sure there are applications of generalized knapsack problems (or dynamic programming generally) in options trading, but this isn't it.
- mrfox321 6y agoThis always happens. Post about X. Somebody replies with, "look at my Y". Usually off topic and trying to take advantage of the posts visibility.
- neximo64 6y agoAre you a tourist on hacker news? This is almost the defining trait of a HN post.
- dheera 6y agoI honestly don't mind "look at this cool related thing I built" comments, especially if it's free and open source and something I can learn from.
- dgellow 6y agoIf you check their profile you can see they created their account 4 months ago, so they are likely to be new here. No need to be disagreeable to make your point.
- omarhaneef 6y agoThis is worth a read if only because of the clear introductory explanation of the market clearing mechanism. However, it’s not a profit maximizing algo that will make you rich (not that there’s anything wrong with that).
- kwhitefoot 6y agoWill it make me better off?
- WJW 6y agoReading more about things you haven't read about before will increase your total knowledge and therefore make you better off in a holistic sense, yes. In a purely monetary sense, no it will probably not have any effect on your life.
- philosopher1234 6y agoKnowledge is not infinitely accretive
- WJW 6y agoI was making the gamble that people who compulsively ask "Will it make me better off?" without having read the article are not yet at the point where they've hit the diminishing returns on additional knowledge. Your statement is correct though, username checks out as well.
- codeisawesome 6y agoWhy not..? Asking because the explanation might end up helping me and also cure folks' HN addictions :D
- philosopher1234 6y agoThis video has a segment on knowledge which I found very interesting https://youtu.be/vtIzMaLkCaM https://youtu.be/vtIzMaLkCaM
- breck 6y agoUnzipped the code and put it here for easy viewing: https://github.com/breck7/drillBits https://github.com/breck7/drillBits (Note: if author wants to create a GitHub I'll edit this link and point to theirs!)
- boxfire 6y agoGiven the clear copyright statement, > Copyright (C) 2020-2021 Terence Kelly. All rights reserved. did you happen to get the author's permission to put that up? I don't even like IP law that much, but its funny to me how much no one gives a shit. This was a crime, albeit a silly and small one.
- breck 6y agohttps://giphy.com/gifs/reactiongifs-DsFhEEGzo9LVu https://giphy.com/gifs/reactiongifs-DsFhEEGzo9LVu
- Kranar 6y agoCopyright infringement is not a crime in and of itself. It's only criminal when it's done for commercial purpose with financial gain which is clearly not the case here.
- zinekeller 6y ago> Copyright infringement is not a crime in and of itself. It's only criminal when it's done for commercial purpose with financial gain which is clearly not the case here. US Copyright laws, sure, this statement is correct. In some countries (especially in Europe and Asia) however, this is pretty much the opposite. (Point noted however that Mr. Kelly is probably American, which assuming you're American will be subjected to U.S. IP laws, especially DMCA provisions. Since that this is unprotected, DMCA circumvention is out and this infringement would be only a crime if this was specifically filed in court, and even them it might be argued that this is more of a civil lawsuit than a criminal lawsuit.)
- infinite8s 6y ago
- bobbydreamer 6y agoJust asking anybody figured out, how to find high low for a period of time. Say in a period of 6months, starting from a initial point, next point could be a high or low, if high, program needs to find next lowest point and afterward, it needs to find highest amd continues to do so in zigzag. For low it's vice versa.
- IIAOPSW 6y agoI think what you are asking is given a time series (x_0, x_1... x_n), what is the 6 month high (or low) on day i? In other words you want the max (or min) of the sub series (x_{i-180},x_{i-179}... x_i). x_0 is obviously the 6 month high at day 0 (since there is no previous data). If x_1 > x_0 then x_1 is the new 6 month high so we can discard x_0 on day 1. If x_1 < x_0 then x_0 is still the 6 month high on day 1, but we cannot discard x_1 because it might become the 6 month high when x_0 expires on day 181. So we need to maintain some sort of data structure of potential 6 month highs such that we can lookup the current high and remove these highs as they expire or get replaced. The easiest way to do this is with a list of pairs [(x_i1, i1), (x_i2, i2)...] sorted by increasing x_i. Because it is sorted, the current high is always found on the element closest to the end of the list. Furthermore when a new element (x_k, k) is added, it replaces all the elements which come before it (thus they can be removed). As a corollary, because the newest element is always added to the back (after removing what's in front of it), the list is also sorted by order of expiry (with the oldest (x_i,i) at the end). Start with an empty list and i = 0 Find the sorted insertion point in the list for (x_i,i). Remove everything prior to the insertion point. Insert (x_i, i) at the start of the list. If the element at the end of the list (x_n, n) is expired (n < i+180) then remove it. The 6 month high on day i is found in the element at the end of the list. Store this in a new series h_i. Increment i by 1 and repeat. This method trivially works for finding the 6 month low as well.
- hntrader 6y agoYou can do it in a single pass fairly easily. Loop over the rows of data. Store the current high to low, as well as the largest high to low since inception. If the current exceeds the largest since inception, simply replace it. Should be about 30 lines of code.
- 29athrowaway 6y agoWhatever you do, do not film yourself and emit a "guh" sound. https://www.youtube.com/watch?v=d80ahvRSV8E https://www.youtube.com/watch?v=d80ahvRSV8E
- Jommi 6y agoThere is a mistake in the article, the 2nd graph is repeated. There is no figure 3.
- msilb 6y agoI was also wondering about the missing figure 3. In the linked pdf version everything seems to be in place.
- secondcoming 6y agoThe Vickery Auction was pretty much the de-facto auction type in adtech realtime bidding. It's since been replaced with standard first-price auctions for reasons I don't fully understand, but I assume it was because websites misunderstood bid prices and though they were being ripped off.
- dgb23 6y agoInteresting, we’re in one of the largest crisis since decades and all these stock trading stories are popping up.