Fiction and Non-Fiction

Tag: #trading

A Geek Moment

It has been many years since I wrote software code for a living, and maybe ten since I last dabbled.

The dabbling was building a database of stock and futures prices using Groovy and the lightweight H2 database. I had a fairly robust application and a good block of historical data when I ran into a couple of problems. The goal of the database was to calculate the relative strength of a stock or future against its peers, as described by Tom Dorsey in his book Point and Figure Charting. At that time, I couldn’t find a Groovy or Java application that allowed me to calculate the results I needed – bad planning on my part as I couldn’t get my head round how to write the code. The second problem was that H2 changed their database structure and for the life of me I couldn’t work out how to migrate.

As a result, the project just sat there with nothing happening. I’m still collecting the raw price data, but right now it sits in flat files on my hard drives and backups.

About three years ago, I dusted off my coding gloves and used Python to manipulate some health care data for a project I was working on. Now Python as I suspect most reading this know, is incredibly powerful and has a host of open source libraries available to the developer. One of those libraries matplotlib has a whole set of finance utilities. I looked at the library, and put my notes aside but the thought of it never really left my mind.

This past week, I pulled out the old Groovy scripts and looked at migrating them to Python. I rethought exactly what I had been looking to do that first time and scaled back a lot of the calculations that weren’t really necessary. The refactoring ended up being much easier than I expected. And fast. Over 200,000 rows into a SQLITE database in about five seconds!

I also found some interesting and illuminating thoughts in Jeremy Du Plessis’s book The Definitive Guide to Point and Figure. I still need to think through the calculation routines based on his writing, but I may not need matplotlib after all!

It’s not Important

When you’re writing, one of the sure ways to stifle your creative voice and bring an in-progress story to a shuddering halt is to make it important.
When I say important, I mean your mind attaches something to the story that’s not rational. This is the story that’s going to pay off the mortgage, or this is the story that will have Hollywood (or Netflix, or whoever) beating a path to my door.
It might happen but the chances are it won’t. Not for that story anyway. I have several of them in various states of completion, and they’ll probably stay that way.
The thing is, it’s not just in writing that we irrationally assign importance to something.
Up until a few years ago I traded options and futures on a regular basis. I let it slide away because these aren’t buy-and-hold trades. They need to be monitored. With everything I was trying to do in my life at that time, there just wasn’t the bandwidth to do it all, so the trading took a back seat.
I went from knowing where the indexes where at any point in a day, to being surprised at a move of over a thousand points in the DOW because I hadn’t looked for a week or more.
This past week I received notice about an inactive account fee on one of my trading accounts. I logged in, and sure enough it was over a year since I’d logged in, let alone traded.
Well, I thought, while I’m here, there looks to be a nice support level on the DOW, and some profit to be generated. An hour later I’d made a couple of trades, and as I sent the order for the next one. I realized I could push the profit to a nice round number if this one did what I wanted.
Typically, the numbers began moving against me. I found myself hunched forward over the desk, willing the lines in the display to move in the other direction because this was an important trade. I really needed that round number result.
Why?
Truth is, I probably shouldn’t have been trading anyway. There was no plan, and no real risk assessment. Each one of those trades could have plunged quickly into a loss, but the real lesson for me.

The trades weren’t important.
Just like that story I agonize over isn’t important.
I haven’t traded since, but I did look at one of those “important” stories. Now time has passed, it’s just another partial manuscript. And it’s not important, but I do have ideas on how to make it a finished manuscript.

© 2024 Richard Freeborn

Theme by Anders NorenUp ↑