Spent the last few evenings checking through my C neural net library and making sure it works properly, then writing functions for several technical trading indicators. The technical inputs to the net (that I’ve written thus far) are open, high, low, close, and volume (of course), plus 8- and 21- period simple moving averages, stochastic oscillators, MACD, and Parabolic SAR.

Here’s a graph where I stuck these all in one plot to make sure they’re working correctly (click for large):

NN Inputs

I’m off to Oshkosh next week, but hopefully will have some downtime to get the whole net running with the inputs and see what happens. The only remaining thing to do is scale all the data on the range [-1,1] in some intelligent manner (like % of period close price) such that the net can have a hope of doing something useful.

At work, we needed to split up some of our DB load since our load is data- and math- heavy. I set out to create a second MySQL server to SELECTs and our reporting so as to move some of that load from the main DB machine.

I was rather pleased to learn that I can set up MySQL replication and bring everything live in about ten minutes (aside from waiting for night to restart the master daemon). Whilst the documentation is a bit thick with all the different ways to set things up, here’s the very simple recipe for one-master-one-slave replication. The master is 172.20.0.1, the slave is .2.

Add this to the master’s my.cnf (editing the paths to match your system) then restart the daemon:

server-id = 1
relay-log = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index
log-error = /var/lib/mysql/mysql.err
master-info-file = /var/lib/mysql/mysql-master.info
relay-log-info-file = /var/lib/mysql/mysql-relay-log.info
log-bin = /var/lib/mysql/mysql-bin

And on the slave:

server-id = 2
relay-log = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index
log-error = /var/lib/mysql/mysql.err
master-info-file = /var/lib/mysql/mysql-master.info
relay-log-info-file = /var/lib/mysql/mysql-relay-log.info

Add the slave user to the master:

grant replication slave on *.* to slaveuser@'172.20.0.2' identified by 'somepassword';

Dump the master’s data and move to slave:

mysqldump -u root --all-databases --single-transaction --master-data=1 > masterdump.sql
scp masterdump.sql user@172.20.0.2:

And once it’s there on the slave, import it:

mysql -u root -p < masterdump.sql

Finally, open an SQL shell on the slave and bring it up!

CHANGE MASTER TO MASTER_HOST='172.20.0.1', MASTER_USER='slaveuser', MASTER_PASSWORD='somepassword';
start slave;
show slave statusG;

When it connects and is all happy, you’ll see the lines:

Slave_IO_State: Waiting for master to send event
...
Seconds_Behind_Master: 0

Slave IO State describes the connection. If it says connecting for long periods, make sure there isn’t a firewall or some such thing in the way of the master on port 3306 (test with nc -vv -z 172.20.0.1 3306). Seconds behind master describes how far caught up the slave is; if it’s NULL, they aren’t synced at all, and if it’s non-zero it hasn’t caught up yet.

Flying the 202

0 comments

March 24th, 2010 in Aircraft Etc, News.

Flew the FP202 this last Saturday, it was quite epic.

As you can see here, the jet engine runs perfectly over a wide range of throttles: (full video link here)

This week we’re (a) building a new steel frame and mounting everything in it and (b) setting up a dashboard with gauges and engine control computer so we get nice graphs of temperature and pressure at several points. We’re also seeing if we can fix the bearings somehow, as they leak oil significantly.

New Lathe

0 comments

February 22nd, 2010 in News, Projects.

Picked up a new lathe on Craigslist yesterday to which I will strap stepper motors and CNC-ize. It’s small enough that I can carry it around the house when neccesary :-) (chuck pic below, tool holder pic here)

Tested everything out today. The combustion chamber fired right up and self-sustained perfectly the first time without any tweaking. That was VERY encouraging, and more so that it worked great over a wide range of mixtures. Here it is running:

We set the the whole thing up on the frame and went to town, but unfortunately things didn’t take off.  We did however manage to set the entire setup on fire a few times, so at least we’re doing something right. Further investigation showed that adding oil pressure to the bearings causes them to seize up, and therefore the compressor was hardly bringing any air in. This created a too-rich condition so the burn continued into the turbine housing and basically caused wide-scale havoc.The plan now is to either get a new turbo that works better, or tear this one apart and see if we can make the bearings work.

More Jet Parts

0 comments

February 16th, 2010 in Aircraft Etc, Projects.

Combustion chamber is done:

My mill is getting some use, but need a bigger one!

Went to the junkyard and Home Depot today - got all the big parts we need other than sensors and whatever display/microcontroller we’re going to end up using. Below is a test of the cooling and lubrication system - originally a power steering pump and a transmission cooler. The pump makes 10psi with very little effort and holds 30psi no problem, so it will fit the bill perfectly.

Tomorrow we’ll be working on the combustion chamber, with luck.

Last weekend we drove up to visit the ice runway at Alton Bay Seaport, B18. Lake Winnipesaukee is a seaplane base most of the year, but in the winter it freezes and the townspeople plow out a 3000′ runway on it. It was wicked cold, but saw some cute planes and helos. Landing on ice is apparently no harder than a grass landing, assuming the crosswind isn’t insane. If you’re landing properly, there shouldn’t be a side load on the gear. Just remember you can’t slam on the brakes ;-)

Thought one: Several years ago, Mike P and I built our hovercraft out of simple materials we had around. We powered it with a leaf blower at first, then tried to install my 22″ propeller (you can see the hole cut for it in the pics) but it couldn’t hold the pressure required. The leaf blower kinda worked, but we certainly couldn’t get both of us on it. A little math tells us that 0.3 psi in the skirt of a 3′x4′ hovercraft will hold 500lbs - about the range I want. But how do we get that volume?

Thought two: A lot of people at home build jet engines using turbochargers from cars: the primary builds 3-8psi in the combustion chamber, which rockets the gas out the exhaust turbine, spinning it faster and stuffing more in, etc etc. These guys hardly produce much forward thrust, BUT they push a very impressive volume of air of at least 1 psi.What can we do with that?

Exactly! Put them together! I’m going to build the only jet hovercraft that I know of. As long as I can get it floating nicely, I have a 24″ prop and motor I can use for forward propulsion also.

I’ve managed to summon some extra motivation and find time recently to do some things I’ve been meaning to do for a long time. For one, I got a new driver for the mill that will run the larger motors. I got it set up and everything works beautifully, I’m just waiting until I have parts that need to be made.

On a more exciting note, I’ve been doing flying lessons at Danbury Airport (DXR) with Arrow Aviation and at Vansant Airport (9N1) in PA. Here’s the nice J-3 Cub I flew at Vansant:

I was happy to find that it flies *exactly* like my own little plane (which makes sense since my plane is a J-3 replica). In any event, I’m trying hard to get my license done this month (unlikely) or next month (more likely) so as soon as it starts warming up I can go off and adventure without hindrance.

Finally, the least exciting - I’ve been coding algorithms to deduce coming events from sudden volume changes in stocks and options. As with all my previous exploits, it will make a ton of income if it works however I’m not convinced I can find the right trends. Nonetheless the risk of wasted time isn’t huge compared to the return of significant gains.

Let’s cut to the chase: I have two flying vehicles :-)

My plane is a Fisher 202 “Koala” single-person ultralight based on a Piper Cub. It has a single-cylinder single-ignition 277cc Rotax, and it very cute.

My other flying vehicle is my hang glider, a Gemini 134:

I’ve flown the hang glider a good few times at Susquehanna Fligh Park where I took lessons and camped out for a few days. They’re in Cooperstown NY, and I’d highly recomend them.

I’ve been working on the plane with my good freind Chris David, just getting everything perfect and peachy. We cleaned out the motor and it now runs perfectly, so we’ve have it out for taxi practice. We still need to do balance checks, but should be ready for short hops down the runway soon.

For flying practice, I’ve been flying the 2-33 (a glider) with Chris. I landed Fitchburg the other weekend and it was very epic. Here we are up over Sterling, MA:

I set up a Wordpress blog for my girlfriend and I last night to track the growth of our garden (you can check it out at http://plants.crepinc.com/). I was only 10 minutes into explaining that pictures had to be resized so as not to wreck the page, then uploaded via SCP and put in the right place with the right permissions, then finally linked in the proper manner when I realized that the whole process was way more complicated than it needed to be.

I hacked up the following two php pages to solve the issue. They allow you to upload an image (no fooling with ftp or scp), have it converted, named, and moved automatically, and generate the code to paste into Wordpress.

The comments in uploader.php explain everything, but the only thing you really need to know is that you need imagemagick installed.

The code is here: http://anna.crepinc.com/wordpress-uploader.tar.gz

Happy Blaggin’ ;-)

About that VPS business…

0 comments

February 18th, 2009 in News.

As you can see below, I spent a huge amount of time last year getting to know different virtualization setups. I got quite good at it in fact… and I came to realize that I could run a Virtual Private Machine service better and cheaper than what’s currently out there. I totally need more to do, right?

Thus, in November I started getting hardware and planning out a company. I didn’t know what it was called or quite how to go about it, but I knew that I had the technical aspects down pat. And 3 months later here we are…

This month I started Paraproc Internet Services (Paraproc). You can get all the details from the site if you’re interested, but suffice to say I provide better packages for less money than what’s currently out there in addition to some services not offered by other providers.

While we’re at it, I’m offering a 2-3 week free VPS for enthusiasts. This helps me load test the system, and in exchange you just tell me if things aren’t working. When your free period is up, you can either give up your access or become a customer. To request a free VPS, fill out this form: http://www.paraproc.com/?request