Archive for August, 2009

Black Box Chronicles – Getting Lost

August 28, 2009

I’m trapped inside a black box. I know, I was warned not to come here in the first place, told my best option was to keep it simple: trade the probabilities, let your winners run and limit your losses. It started as a simple glance, really. Then a gaze and then I took the first step into the black box. Now, I don’t know how to get out. Don’t be alarmed, I’m comfortable here. The people (creatures, really) are pretty nice so far. But I need to leave here at some point because from everyone I’ve spoken to, you can’t trade while you’re in the black box. That seems patently absurd to me since the black box is system trading, and ‘trading’ is part of system trading. Right now though, I’m not in the mood to argue. There’s some pretty cool stuff in here and interesting creatures roaming about that I’ve got to bring out.

For starters, there is enough gold in here that if I could just get a small fraction of it out, and the price of gold went to zero, I’d still be rich. I’ll worry about that later. Let me first relate the conditions surrounding my entrapment.

It started when I decided to leave the world of discretionary trading. That was a tough choice, but sometimes defining moments present themselves to you and you simply need to do what it takes to define yourself. Almost by default, system trading was the last method standing. So that’s the path I took. With system trading, I must warn you now, once you start poking around it doesn’t take long to follow so many winding paths that you can’t remember how to get back out. That’s what happened to me. My pursuit of system trading has led me into the trader’s black box. Trust me, it’s a lot more than a group of algorithms. I feel lost now, but at the same time I feel like I’m at home.

The first creature I came upon in the black box is a curious fellow. He’s a nice little man that reminds me of Yoda. I couldn’t figure out at first if he’s the janitor or actually runs the place. I’m still not sure.

So I asked him,’What is this place?’

He replied ‘It’s a black box.’

‘As in a trading black box?’

‘Yes,’ he says.

‘Where can I go to place a trade then?’ I’m feeling a little giddy at this point, like I’ve arrived by default in trader’s nirvana.

‘You can’t place a trade while you’re in the box,’ he says.

Not the answer I was expecting. It’s called system trading. And black box or no black box, there is trading in system trading.

‘Fine,’ I said, ‘then can you direct me how to get out of here?’

‘You don’t ever get out of the black box once you’ve entered it. You have to become the box.’

More bad and unexpected news. The song ‘Hotel California’ starts looping in my brain. But between you and me, I think he’s just the janitor.

I decided to keep exploring and leave this nice little man alone for awhile. So far, I’ve met many old friends whom I’ve never met in person before. Simple Moving Average is here, as is RSI, MACD and even Head&Shoulders (he’s a big fella, as one would expect). There are also these little furry balls that run around the place screaming “got to find the best parameter” in a soft, squeaky voices. They call them swarming bots. I’d like to kick one across the room, quite frankly.

I also ran into ADX. He was kind of bummed out telling me how it’s hard for him to get work lately. I promised him I’d send some work his way once I got out of the box.

Curiously, he told me the same thing as that nice little man. ‘You can’t leave the box.’

I’ll attribute that to the medication he’s obviously taking. You see, contrary to popular trading myth, there actually is emotion in the black box.

There is so much to explore in here, I’m cool with hanging out for a while. For instance, I’ve always wondered what the deal was with Fuzzy Logic. I just saw him pass by and he’s on my list of people to interview.

Yes, I realize that one can spend too much time exploring every possible trading method and form of technical analysis. After all, traders trade. We’re not perpetual students of methodologies. But since I can’t figure how to get out of this place at the moment anyway, why not spend some time enjoying myself?

On my list of places/people to see while I’m trapped in here.

1. Genetic Algorithms
2. Particle Swarm
3. Intermarket Correlation
4. Visual Basic and C# programming
5. Statistics
6. Neural Network
7. Kernel Regression
8. Fuzzy Logic

And that’s about it. After that, I’ll commit to getting out of here. I’m not too concerned about it, really. These walls are sort of fluffy. And the air is refreshingly crisp.


Closed SPX and RUT Iron Condors for August

August 19, 2009

Yes, I’ve filed for a divorce with high-probability trading, but there is the matter of leftover trades that must be dealt with. These are the last Iron Condors I’ll be doing for a while. The next one I do will be hatched under the roof of systems trading. You’ll see that I didn’t do what I said I was going to do with both these trades, and my assumptions about what the market was going to do for the next six weeks was completely wrong. I changed my mind as the market conditions changed, and in the mean time I endured the rather unpleasant emotions of dread, loathing, fear, resignation, hope, more dread and so on.

I put on the SPX Iron Condor trade for August at the strikes of 785/790 (puts) and 1010/1020 (calls). My credit was $1.15. You will notice that I skewed the trade towards the downside. My risk was greater on the upside ($10 on the call spread) than on the put side ($5 on the put side). The reason: I wasn’t too concerned about a rally, but more concerned about retesting the lows. Okay, you can laugh now.

I put on the RUT Iron Condor trade for August at the strikes of 450/460 (puts) and 560/570 (calls). Credit received was $3.15. My reasoning was that the market wasn’t going anywhere for a couple weeks, and I would take the trade off for a small profit with more than two weeks to expiration. Yes, you can continue to laugh.

If you trade with discretion, you really need to get past the fact that you will be wrong at times, sometimes dismally wrong. Discretionary traders who have been stung by wild market action that is in complete contradiction to their views tend to hedge their opinions going forward. I’m not going to make attempts to convince anyone that they should hedge their opinions in the market. Not because I’m concerned about you neophytes not listening to me, but only because it is completely worthless. Worthless because it takes personal experience to learn this lesson in trading, and good-intentioned words from others probably does more to hinder your development as a trader than help. Pay your own tuition. It’s the only way.

An Iron Condor is a hedged position by definition, because your further out strikes protect you from unlimited loss. The SPX trade this month had a total risk of $8.85 for a potential reward of $1.15. The RUT trade had a risk of $6.85 for a potential reward of $3.15. Not your typical positive expectancy scenario, but this is the strange world of options we’re talking about here.

Anyone following the market in the last few weeks would have observed that the SPX breached the short strike of 1010 and almost hit the hedge of 1020 intraday. In the RUT, the short strike of 560 was breached and the hedge of 570 was also breached as the index traded at 577 intraday. That’s enough to discourage just about anyone. It’s usually around the time when the price starts touching your short option that you begin devising ‘adjustment’ plans. You can move your short call spread up a strike by simply purchasing a like-option butterfly. For example, to move the RUT 560/570 call spread up to the 570/580 strikes (which gives you more breathing room), just buy the 560/570/580 call butterfly. Diagram it out on paper, it works.

Adjustments cost money though, and it doesn’t take long for you to become confused as to what you’re trying to accomplish. I chose not to make adjustments.

On Wednesday before expiration (tomorrow is the last day to trade AUG SPX and RUT options), I took the trades down. That is, I took off all the risk.

For RUT, I decided that buying the 500/560 AUG strangle was the best choice. It was marked around $4.20 before the open, but the futures were down so I put in a standing bid of $1.99. While I was buttering my toast, I heard the opening bell ring. Sauntering over to the monitor, I noticed that the order was not working, but was in fact filled. Holy smokes, that was fast! Okay, good. No risk is left and I have a small profit.

Next up the SPX Iron Condor. The strangle approach wasn’t working out so well. I had a bid for the 800/1010 strangle for $0.75 and when I saw it being marked at $0.62 after the open, I canceled and replaced it with a bid of $0.50. The spread got away from me and went to a $1.00. Now the sell-off from the close was getting challenged and that 1010 call was getting more expensive to buy back. The 800 put was going into no-bid land (zero bid, ask a nickel) where nobody wants to fill you. It was mucking it up. Another approach was to buy back my short 790 put for a nickel and work on the short 1010 call. And that’s what I did. Bought back the 790 put for $0.05.

I realize it’s hard to keep track of all this, but you will recall that though I neutralized my RUT Iron Condor (took off all risk), I still had long options, namely the 460 put (worth less than a nickel) and the 570 call (worth around $0.80). I was thinking of the long 570 call as a hedge against a melt-up on the markets and against my short 1010 call in SPX. Different markets, yes, but it helped me take a breath and consider an orderly exit strategy.

I bought back the SPX 1010 call for $0.90. That made the profit total $0.20. Big whipty do, I understand. But remember I was facing a loss of over $8.00 just last week. Now with my risk in SPX off, I sold the RUT 570 call for $0.65, and the long 1020 SPX call for $0.30.

After all was said and done, the profit from the SPX Iron Condor totaled $0.50, and the profit from the RUT Iron Condor totaled $1.81.

I was worried that when I announced my break-up with high-probability discretionary trading, she would sell my golf clubs to the punk kid next door for $20. But she hasn’t done that. Maybe she wants to get back together, who knows. You never can tell about these things.

Backtesting the Bumblebee (Part Two)

August 16, 2009

I only broke this up into two separate blogs because if you endured the first part, you may be interested in the second part. But you also may have had enough. I know polite readers will finish what they’ve started, so I wanted to give them a logical stopping point. In this part we will continue our exploration of how Bumblebee performs on historical data. So far, we got decent results from a 10-year test window in one market. Now, we continue down the rabbit hole.

Bumblebee’s performance in crude oil over separate 2-year windows is depicted in the following spreadsheet:

I’ve highlighted in blue the pleasant surprises, and used orange to point out the not-so-good results.

Our next step is to see how Bumblebee works on different markets. There is no expectation that it will do as well or as poorly in other markets. We’d like to see it do well in at least some other markets though. The eight other markets include corn, cotton, coffee, dollar, yen, gold, S&P 500 and Ten-year note. Once again, I’ve used blue to highlight pleasant surprises and orange to highlight dubious results.

So far, we can see that coffee and S&P 500 futures didn’t do so well. They lost money. But the good news is that about 78% of the markets actually made money, though cotton and gold pulled in a meager performance of around 3% each.

Nine markets over ten years yielded 641 trades, which is statistically valid. Taking the good with the bad, the consolidated performance gave us a 23.7% annualized return. Hmmm, I do believe this system bears further investigation. Let’s get granular again and divide up these overview reports into 2-year chunks to see if they yield any more information about Bumblebee.

Here is the S&P 500. Clearly not impressive. From 1989 to 1992, this system was dismal, to be kind. The only impressive result was long trades between 1995 and 1996.

Coffee is another market that eats this system alive. Six out of 10 years were losers, some with painful drawdowns.

Before we get completely depressed, let’s admire how the system performed with 10-year notes. The periods of 1991 to 1992 and from 1995 to 1996 yielded better than 100% returns, with long and short trades taking turns in the bounty.

The Dollar also shows some nice returns with the system, including some nice 300% returns from the short side in three separate test windows.

Gold is kinda lackluster, but at least the losing windows didn’t see too large a drawdown. Nice short trade in 1995 to 1996.

As for the Corn trade, not that impressive. The big long winner in 1987 to 1988 helps keep this one above water.

The Cotton market responds very similarly to the Corn market, with lackluster results, the decent returns from 1989 to 1992 notwithstanding.

I’ve saved the best for last, but what would you expect. The system performed well in the Yen market from 1987 to 1988. Overall annualized return was 132%, which was helped mightily by a 959% return on long trades during the period. This sort of result is almost too good to be true, so we have to give it guarded respect. It’s cool to look at though, and would be even cooler if it happened again in the future.

That is a lot of data to digest. It is just a start though. Next we optimize. As the backtest was a guardian against the trade idea as whimsical fancy, the optimization process will be a guardian against the backtest being the product of pure chance.

Backtesting the Bumblebee (Part One)

August 16, 2009

After one has formulated a trading idea, coded it and tested that the code does what it’s supposed to do, it’s time to put the notion to a test based on historical data. Don’t be scared and quit biting your nails. This is good for you. Backtesting is the arbiter of the trading idea. You can’t make the swim team unless you can first swim across the length of the pool. You cannot trade a system that has not shown it would have actually made money in the past. I’m assuming you are a trader whose objective it is to make money in the markets, and if you’re a different sort of trader, you may not want to keep reading. By the way, I pass no judgment on you if you choose to trade for reasons other than to make money. For the profit-minded sort, it will not require too much persuasion to convince you that we only want to trade systems that have shown potential for making money. Backtesting will show that a system either has the potential to be a traded with real money or is nothing more than whimsical fantasy. If you suspect your trading idea is whimsical fantasy, then you may choose to keep it somewhere safe, because this is going to get a little rough.

I’m taking 20 years of data to backtest Bumblebee. You will recall that the system is a trend-following system that uses a Bollinger Band around the slow moving average to create four lanes for our faster moving average to occupy. We enter long when the fast is in the upper lane, and close the trade after it moves into the third lane. We enter short when the fast MA is in the bottom lane, and cover when it breaches the second lane from the top. Entries and exits are on the open of the next bar.

My market for the initial test will be crude oil (continuous contract). I’m only backtesting the first 10 years of data and leaving the second block of 10 years in a super-secret location that the system doesn’t know about. I told you it was going to get rough. Below are the results of how Bumblebee performed from Jan 1, 1987 to Dec 31, 1996.

You will notice that the annualized profit of this system is 45.24% over this 10-year period. Not bad. But hold on skippy. We should be asking ourselves if all the profit came from one year while the other nine years were pain-suffering malaise. We don’t know from our first run of the data. So it’s time to get granular. We are next going to divide up that 10-year block of data into five 2-year chunks. That way, we can check if the system is consistent or if it gets lucky once a decade. Before we do that, let’s notice some other characteristics of the system.

Winning percentage is less than 50%. Not atypical for trend-following systems, but if you’re psychologically disposed to having the bulk of your trades being winners, you may decide it’s safer to eat glass than to trade this system.

Profit factor is 2.56. That means at the end of the day, our gross winnings outnumber our gross losses by that factor. If we were to break even for the period, we’d have a profit factor of 1.0. Any number below 1.0 is a net loser. Obviously, we’d like our profit factor (PF) to be large. It would mean money is flowing into our account, and we are charged little to be at the table. Our profit factor is not bad, but let’s keep an eye on it just the same.

Net profit as a function of maximum drawdown. I’ll admit, it’s a mouthful. Basically you’re trying to see how much pain you must endure to realize your profits. With the handy little calculator provided free-of-charge on your PC, you can see that Net Profit ($43,590) divided by Max DD ($9,640) is 4.52. Essentially, we put one dollar at risk to make $4.52. This number goes negative whenever we are overall losers. An interesting metric we shall also keep an eye on.

Long returns versus short returns. It’s not in that crummy little graphic above, but let me just tell you what it is. Longs had a 59% annualized return while short trades had a annualized return of 36%. Not totally skewed either way. That’s a good sign that the system is not overly disposed to either the long side or short side.

In Part Two we will see the results of crude oil divided up into five equal 2-year periods. And then to test the robustness even more, we will do the same thing on eight other markets so we end up with 45 reports. Five reports per market, nine markets total. This is why I purchased Excel.

Trading shibboleths are acid on the brain

August 6, 2009

It’s virtually impossible to have a meaningful discussion about trading with someone whose contribution is proudly limited to spewing trading shibboleths. Their account never suffers a loser because of their faithfulness to petty phrases such as ‘the trend is your friend’ or ‘trade what you see, not what you feel’ or ‘keep your losers small and let your winners run.’ Shibboleths are popular phrases that have become devoid of meaning. Those who repeat them are revealing themselves for who they are.

What does ‘the trend is your friend’ actually mean anyway? (donning my Andy Rooney hat) Jesse Livermore planted that phrase into the minds of traders as a means of gaining an edge over them. Get them babbling about cute phrases that rhyme and take their money in the interim. They’ll be content to watch their accounts dwindle as long as they have some shibboleth to grab hold of to explain the recent depreciation. Whenever they have a winner, program them to say ‘I let my winner run.’ And whenever they have a loser, program them to say ‘I should have kept my losers small.’ That way, instead of them thinking about what they’re actually doing, they’ll be thinking about applying the most appropriate shibboleth as the situation demands. Confusion in your adversary is key.

Do you ever notice how dumb you feel when you repeat some retarded trading shibboleth? That is by sinister design. It’s psychological warfare out there and the dirty little secret is that other traders constantly try to gain an edge over you. When you feel dumb, you’re likely to act dumb.

Next time you have the urge to spout meaningless dribble, resist. Don’t even try inverting a popular phase, such as cleverly stating ‘the trend is not always your friend’. You’re wasting your time and brain cells. Think about what you should be doing instead of what phrase you should be repeating.

Now go grab the bull by the horns and get trading. Or something like that.

I’ve filed for a divorce

August 4, 2009

I think, and hope, that we can still be friends, but my days of being married to high-probability discretionary trading are over. This separation is amicable and mutually agreed upon. We had a good run, but things ran into trouble last year when the market gave us something we’ve never seen before. Our relationship has never been the same since. The screaming, the accusations … oh, it got ugly. I thought maybe we could work it out this year, but this latest 3-week rally has put a permanent end to our relationship.

High-probability discretionary trading is the mistress or spouse of many traders. She is seductive, beautiful and addictive (lady traders, feel free to visualize her as a him, if you’d like). She promises, and oftentimes delivers, low risk for high reward. There is nothing so alluring as visualizing a setup that has a defined risk (the place where the trade no longer works) and its potential reward, which can be five times larger or more than the risk.

High-probability discretionary trading’s father is Poker. He taught her growing up that it’s all about betting based on the size of the pot and your individual odds. He taught her that you don’t need to play every hand, and sometimes it even makes sense to fold a good hand to get an idea of how others are playing.

Where my relationship with high-probability discretionary trading went bad was in my expecting something from her that she could never deliver. Probabilities that were actually based on reality. You see, her probabilities are a little problematic, and she will be the first to admit it. I know there are many successful traders out there who are still very happily married to high-probability trading, and maybe things would have been different with me if I had just listened more. Who knows. It is what it is.

Even though I’ve had relationships with fundamental trading, intuitive trading and emotional trading, I found high-probability trading worth getting married to. Now that I’m moving on, I’d like to introduce you to my future spouse: system trading.

I know she’s kinda boring compared to the others, but I love her for that. She’s a little frumpy, awkward in public and can’t play sports, but she’s a bit more real to me the than the flashy others.

System trading takes a notion or idea and puts it through a scientific process of validation. It includes backtesting, optimization and walk forwards. It involves compiling a statistical profile for a trade system and the market to be traded. When she fires off a signal, you take it. No discretion. All the work you’ve done on understanding the system depends on you taking every signal. It’s a very committed relationship that way.

If all you like to talk about is the latest reality show and what your neighbor is selling his house for, then you probably won’t like system trading. If you like Wittgenstein, Tolstoy and Gabriel Garcia Marquez, then you may have found your mate. We talk about things like intermarket correlation, genetic algorithms, neural networks, particle swarm optimization and fuzzy logic over breakfast. It’s fun, but then that’s me.

You don’t need to follow trading rules

August 3, 2009

We’ve all heard the proselytizers of trade planning bemoan lesser traders that they need to follow their trade rules. Yet, emotional traders still dominate the retail trading landscape. After hearing about how bad they are for acting as they do, they flagellate themselves for allowing emotion to enter into their trading decisions and re-dedicate themselves to discipline trading without emotions. But who are we to judge why and how someone else trades with their money?

Of all the different types of trading styles, I find the emotional style of trading the most entertaining. It is more human and natural than a game of probability. There is personal stuff at stake. Anyone who preaches to you that you need to stop it and get a plan is really preaching to themselves. They are healing a wound, or trying to convince themselves that they no longer participate in the egregious activity of trading without one. They are essentially scared of their emotions.

You cannot detach yourself from your emotions. If you want to trade based on emotions, I support your decision. After all, it’s your money and it’s not my place to tell you what to do with it.

Rules. We think of them as ‘made to be broken’ for a good reason. Rules are limiting and suffocating. Yes, we need some basic ones in our lives, but as soon as a method of trading is defined as a rule, the inner workings of the imagination begins the task of find ways around it. It’s only natural. Our total human experience cannot be contained with stupid rules. And who is making these rules anyway? Why are they valid? We all know that rules are put in place because we basically don’t trust someone (maybe ourselves) to do the right thing when the time comes.

Rules are really a false sense of security. Your contrary imagination will find a way around them, as water finds its way around rocks. It takes more than rules to prevent yourself from being stupid.

You don’t stick your hand in a fire because you’re following a rule that one should never stick their hand in a direct flame, but rather you’re resisting the urge because you have some common sense and an underlying urge towards self-preservation.

Become comfortable with yourself. And if you are recovering from the horror of losing large sums of money due to your own compulsive behavior, please don’t preach to the rest of us about how much we need to follow rules.

If you should decide to employ trading rules, have it be because you choose to make your trading simpler, not because someone told you that you need them.