The 2x2 State Machine as Trading System
I was taught to set up my quantitative experiments on a 2x2 grid with the first independent variable on the left side (up/down) and the second independent variable on the top (up/down).
A mathematical treatment is given in this pdf and there is an entire book on 2x2's here.
Here's how to transform a 2x2 grid into a trading system that's probably a little different than what you are used to:
- Choose two independent variables with an identified edge, e.g. stocks and bondsA nice side effect being that it scales into and out of positions naturally.
- Draw out the 2x2 grid and add the appropriate buy/sell action to each sell, e.g., stocks down and bonds up = buy, stocks down and bonds down = sell, etc.
- Code the entries and exits so they happen incrementally, adding or subtracting x contracts from current positions based on state.
Test, tweak, repeat.
As the wise man once said, "A meal for a lifetime."