Milktrader

Iterating Until Convergence

Saturday, December 18, 2010

White Bumblebee Implemented in R

White Bumblebee is a trade system based on a simple moving average crossover, but with a special twist. Imagine your thermostat triggering your furnace to shut off or turn on every time a temperature crossed a threshold. If the thermostat didn't have a buffer built in, you'd wear out your furnace with too many on/off cycles. I'm not an electrical engineer, but the basic concept behind this buffer is called hysteresis. In trading, it's called a Bollinger band. And that's the crux of White Bumblebee.

Saturday, December 11, 2010

White Bull, An Algorithm in R

Algorithms are curious creatures. They behave in a very predictable way. They do as they are told and do it the same way every time. What they lack in imagination, they make up in reliability. You cannot talk an algorithm into saying something it's not programmed to say, and it will not offer you two sides to every story. No, these critters are pretty cut-and-dry.

Sunday, December 5, 2010

Secret Code for a Six-Year Old Spy

I was teaching my six-year-old spy the ins-and-outs of spycraft coding last week. What a better opportunity to introduce letter substitution I thought. Well it soon became apparent that our crayon-and-paper methods needed some technology improvements. Enter Ruby. I wrote a few simple lines that can be copied into the irb console (Ruby's interactive console).

Here is the plan. Create two arrays. One of the alphabet and one of the alphabet all mixed up. Then combine them to create a hash of key-and-value pairs. Once this process is complete, a message can be coded and a mixed-up message can be delivered to other participants in the spy ring. Standard stuff.

Thursday, December 2, 2010

A Neighborhood Metaphor for C Pointers

I take back all the mean things I've said in the past about C pointers. It was really more a product of confusion, but all that has changed now. I am now pleased to present an explanation of C pointer basics in terms of a robust metaphor.

Let us assume that we are all comfortable with the notion that in C, a variable is created with an explicit data type. When you create a variable, you are creating a rental house. In C, there are strict rules about who gets to live in what house. It's just the way it is.