About

quant_rv is an exploration of building a usable ETF trading strategy based on a logical relationship between volatility and stock prices, written in R.

Status: July 3 2023: reached first goals (yes, we probably can beat the market), established new goals, and more to come soon.

Codez: The code is short, commented, and written in R which I find exceptionally readable, once you get used to how easy coding for vectors (ie, price series) is. And easy for a novice R programmer to get started with (install R Studio, copy/paste some R code into a file, run it [in R, this is “source” it]).

Goals for quant_rv: read the July 3 post to the end: https://babbage9010.wordpress.com/2023/07/03/meeting-goals-setting-higher-goals/

You can reach me through comments on this blog (don’t make it spammy, or I’ll never get to read it) or on twitter @babbage9010, or via GitHub https://github.com/babbage9010/quant_rv.

=== long, unessential stuff follows ===

I’m a scientist first, programmer second, teacher/farmer third, and a very amateur, self-taught quant. I’ve built and abandoned a number of semi-successful quantitative strategies. A notable achievement was not blowing up during the volpocalypse of Feb 2018 despite running a volatility-risk-premium strategy during that time (I went to VXX on the Friday before the implosion of XIV), which was helpful, but then promptly lost all my VXX gains when the market fell back to Earth more quickly than my strategy could follow.

I gave up quant codez for a year or so, but in April I ran across an article where ChatGPT helped craft a simple demo strategy in R utilizing realized volatility. That simple code got me to reinstall R Studio and start coding again… I had played with R before, but never got serious about it, until now.

So, here’s where I will blog about my explorations, and invite you to join me in the comments and I promise to explore (or reject) actionable suggestions for ways to improve OUR code.

quant_rv itself will be designed to allow use by anyone. It will generate signals based on closing prices and trade at the market open on the following day, so there’s plenty of time to run the code, consider the signal and put in a broker order for a trade. The strategy will focus on big, liquid index funds (SPY, QQQ, etc) so that it can be scaled readily. quant_rv aims to beat the market benchmarks on a risk-adjusted basis… the first version won’t, but we’ll work toward a version that will beat it, together. We will explore tricks and tips to help you and me become better quantitative trader/explorers, and study the pitfalls we should avoid along that path.

The first blog post will set the stage with a simple realized volatility strategy, utilizing the well known bias in the market that low volatility days skew toward positive gains. Then we’ll explore how to leverage that approach further in creative ways.

I’d appreciate your help 🙂 I’m a fair coder, but new-ish to R, so I’m always open to improvements there. I’m a rank amateur in quantitative finance, so I’ll be open to suggestions there too. But mostly I’d like your creative ideas to help advance this strategy. Feel free to use ideas we generate for yourself, for your own (private, proprietary) strategies, even for your work (if you work in quant finance), and iterate and improve them. But if you can share some ideas back with us, I’m sure good will come of it.

I expect to plod along at a leisurely pace and over-explain things, so that duffers (like me) who are new to this can follow along. Bear with us neophytes struggling to grow our IRA accounts, you advanced Gods of Finance. Oh, and all the codez will be posted both here and at GitHub, here: https://github.com/babbage9010/quant_rv

Blog at WordPress.com.

Design a site like this with WordPress.com
Get started