Sunday, October 30, 2005

Watch list for week of 10-31-05

I ran my market homework software this weekend and prepared a watch list for next week composed of the highlights from the scan. I was pleased with the quality of the chart setups on the first three charts in particular that I've listed here:



One of the stocks on my watch list from last week PYX had quite a nice rally. This is the kind of action I need to see before I start buying stocks. Gorden Gekko at The Knight Trader had coverage of the PYX breakout last week. I'll be watching his commentary more closely in the coming weeks to help determine the demand for speculative stocks, which I think may be starting to improve. That said, I may try to do some buying in stocks from the top of this week's list.

Another arrow in the bull's quiver is the XLF. It appears to be breaking out to new highs on the weekly chart.

I'm not going to run out and cover all my shorts yet though, the new 52-week highs:new 52-week lows ratio is still horrible (31:94 on the naz) and the market is still in a technical down-trend on the nasdaq composite daily chart. This overrides any anecdotal bullishness on individual stock and sector charts.

Thursday, October 27, 2005

On intra-day reversals

I was asked a great question today, and with that person's permission I wanted to post the question here along with my response, and anybody who has anything to add or dispute, please comment.

  • "Why does a stock rally a good amount after an earnings release that shows great earnings.. Then drop to a loss in the last hour of trading.

    I made great gains on build a bear and buffalo wild wings.. Only to have them lost in the last hour of trading. Should i have sold along with them?"


Here was my response:

  • Your observation regarding the action in the last hour of trading is a very good one.

    It has been my experience that a stock that is making lower highs and lower lows (downtrend) on the daily chart will have a tendency to close in the lower half of its price range for the day. The reverse is true for stocks making higher highs and higher lows on the daily chart (uptrend). For this reason, I make my trades almost exclusively in the direction of the trend on the daily chart when it is the same as the trend on the nasdaq composite daily chart, and refrain from making most of my buy or sell decisions until the last hour of the trading day. Most of my trading is done in the last 30 minutes of the day, but occasionally like today when there is an intra-day reversal I will make quite a few trades in different stocks I've been watching throughout the last half of the day.

    The closer you wait until the close to do your trading, the more information about the price action that day you will have, but like you pointed out, that information comes at a cost because you possibly could have had more favorable prices earlier in the day. I've told you what makes me comfortable, but it all comes down to whatever is comfortable for you.

    It is interesting that you mentioned being long BBW. I shorted that stock about a month and a half ago when it was upgraded (the gap up in September) but I took a loss on the trade, I covered my position a day before the gap up that your profits came from. You can probably see why I covered, and I suspect maybe that was your reason for going long at the same time? The problem with BBW and BWLD is that the nasdaq composite is trending down, so lower closes are more likely for those two stocks than you would otherwise expect.

    Don't worry too much about losses. Trade the charts, not your account equity. If you catch yourself trading based on your account equity, then shrink your trade size.


Here are the related charts, including my notes (click to enlarge):












Note the reversal candle today on both the nasdaq composite and BWLD. This is no coincidence.

Wednesday, October 26, 2005

Profit factor walk-through in my backtesting software

I've talked a bit recently about the java software I've been developing for backtesting and automating trades so I thought it would be a good idea to outline some of my recent progress here with companion images.

One of the primary statistics that I'm concerned with when looking at the results of a trading system backtest is the Profit Factor. The Profit Factor is computed as follows:

(PW * AW) / (PL * AL)

Where

  • PW = Probability of a trade being a winning trade

  • AW = Average win size

  • PL = Probability of a trade being a losing trade

  • AL = Average loss size



Profit Factor basically describes the historic profitability of a series of trades. For example, a series of trades with a profit factor of 1.0 is break-even. Another more specific example might be a system that generates trades with a 50% chance of losing and a 50% chance of winning. For this system, the average win size is 3 times the size of the average loss. So:


  • PW = 0.5

  • AW = 3

  • PL = 0.5

  • AL = 1



And when we plug it into the formula, it looks like this:

(0.5 * 3) / (0.5 * 1) = 3

As long as the numbers remain the same in the future, we can expect this hypothetical system with a profit factor of 3 to be very profitable. In fact, the more frequently we trade it, the larger we would expect our compound returns to be. The reason for this can be simply explained by considering two casinos, each with a house edge of 55%. Obviously the higher volume casino will have larger earnings over an identical timeframe.

When backtesting a system, it would be useful to know what the best stoploss and profit target values are for that system, so I wrote a module that computes the profit factor of every combination of stoploss and profit target, and outputs the data to excel where I can graph it easily. Here is the graph for one of the systems I've began to develop (click to enlarge):




One of the major reasons graphs like this are important is so that you can make sure you aren't over-fitting your system to the data set you are testing it on. If you simply have the computer find the very best profit factor out of the batch, you may end up with system parameters that merely take advantage of a coincidental price sequence that never repeats and won't be profitable in the future. Parameter clusters that form broad hills tend to be more robust and reproducible in the future. In the graph above, there are two significant hills, with a spike at the top of the one on the left. I wouldn't necessarily expect the parameters coinciding with the peak on the left to reproduce quite that good of results in the future, but the fact that it is on top of a hill means that it is still a favorable parameter set, and a good candidate to look further in to.

So here are the backtested trade results from one of the parameter sets at the peak of the left hill (click to enlarge):




As you can see in the totals at the top, the longs are more profitable trades to take. That is because the market is trending up in the 3 year data sample that this backtest covers! When I filter out the short trades, only analyzing long trades, the profit factor of the system goes from 3.1250 to 9.6654! However, the long-only system is less profitable over the same three year timespan because it is taking only 28 trades with a profit factor of 9.6, whereas the bi-directional system has 56 trades with a profit factor of 3.1 -- slightly more profitable, and makes money in a wider range of market conditions. So a possible future direction for this simple system of mine might be to find a good way of identifying long-term market uptrends and downtrends as an indicator for overweighting long or short trades.

Monday, October 24, 2005

Watch List for week of 10-24-05

My software didn't come up with anything I'm interested in putting money on this week. Most of the bases it showed me did not look very mature. Here are the highlights:



I saw IBD featured an interview with Ray Kurzweil on pages A4 and A5 of this weekend's paper. I've mentioned Ray Kurzweil frequently on this blog. Most recently was in September when I wrote about the role of accelerating technology in the area of risk management. I almost jumped out of my seat when I read this paragraph from IBD's interview with Ray because of his own remark on risk management:

  • The interneural connections [of humans] do computations at about 200 calculations per second, which is a million times slower than electronics. And there are many ways human intelligence gets easily confused, like in understanding risk. We can create nonbiological systems that are thousands of millions times faster, and we'll be able to combine our strength of human intelligence, which is principally our pattern recognition.


This is already going on. My own stock trading strategy is a synthesis of machine strengths and my own strengths. I feel that I've reached the point where it is easier to improve the machine side than improve my own assessment abilities so I have been focusing the bulk of my efforts on that for the past few months. I have been developing in java a suite of tools for scanning and manipulating price data, technical indicators, backtesting, and statistical extrapolations from the backtesting. Eventually my plan is to let the machine take over my trading in derivatives and forex almost completely. I still plan to do discretionary trading of common stocks as a way of diversifying, and because it is pretty fun too =D

Friday, October 21, 2005

Ed Seykota on trends

I noticed a new article on Ed Seykota's site, a discussion on trends. Ed quickly gets to the bedrock in his usual lean and powerful philosophical approach. He says, "Motion, velocity and trend do not exist in the now. They all disappear in snapshots." The argument is similar to those put forth by Zeno in his famous paradoxes, however many of the objections regarding the discreteness of time and space that people make to Zeno's paradoxes do not hold at all for market prices. It is plain fact that bid/ask quotes are discrete. Ed says it follows that, "Technically, since trends do not exist in the now, they do not exist at all and there is no such thing as a trend."

So how does one of the greatest trend followers of all time make his money if trends don't exist? Simple! A trend is an arbitrary definition of conditions that can be queried with price data. When the conditions are met by the given price series, it can be said to be in a trend state. From this premise, Ed goes into some examples and an exercise.

What I took from Ed's article is that the way you define price action, whether mentally or systematically, has everything to do with your ability to profit from it. More robust price action models naturally have more profit potential.

Wednesday, October 19, 2005

Nasdaq bounces off of dual resistance


Nasdaq bounced off of dual resistance today: the declining 10-day SMA and 200-day SMA. You have to weight the price action by the volume, so this is pretty bearish stuff over the past couple weeks. If the volume balloons while price declines over the next few days, then the nasdaq may stay oversold for quite a while.

Sunday, October 16, 2005

Watch list for week of 10-17-05



Why even bother with a watch list of buy candidates when I'm up to my eyeballs in short positions? Because it is my business to keep close tabs on the demand for speculative stocks. The reactions of these stocks this week as they reach their boiling points will give me early clues if the speculative money starts to get frisky. I'm not holding my breathe though.

Another interesting chart that my software spit out at me this weekend is one of my favorites from last year: AIRT. You can see on the weekly chart that it has found support at $10, but if that price level fails, the next support looks like $5 to me. I think the $10 price will fail soon because the trend on the daily charts in both the market and the individual stock is down, but I don't short low-float stocks like this one. This is my spectator sport of choice =D

Based on all the charts I've seen lately and the new 52 week lows outnumbering the new 52 week highs by a wide margin, I'd say the odds are high that this earnings season will turn the markets into a trainwreck. A glance at the weekly nasdaq composite chart shows that if the markets start tumbling, it may yet have a long way to fall. The way I see it, you can either trade chart setups, or use the setups to get you into trends where the money is made during extended periods of overbought or oversold. It is fairly obvious from the notes in this blog that I prefer the latter.

Saturday, October 15, 2005

Complacency, conspiracy, and liquidity

I know what investor complacency is. It is running in and buying every "oversold" dip in the market because it has worked for the last three years. Or buying on a bullish osscilator crossover coinciding with a put/call ratio of 1.0 because "thats what markets do when they bottom".

This past Thursday morning, the market was on the precipice. It was going to crash or rally. I was already short up to my waist, but I sold even more stocks. I sold stocks to a lot of different people, some of them were complacent buyers, and others were sharpshooters like my friend Jarod, who correctly called the short-term bottom that morning. I don't trade like any of those people though. I'm perfectly happy to sit short through a limp-volume rally in a market that has been trending down for a couple months because it tells me that my position is as secure as I could hope for.

The problem with being on the wrong side of a rare event is that you can't count on liquidity when you need to get out. However, on the other side of the trade you have plenty of liquidity if it moves against you, and the best situation in the world when it moves for you.

My point is that there are catalysts in place for a rare market event in the next couple of months: Greenspan and Snow are over in Beijing hashing out currency and trade issues while congress has their finger on the trade war button labeled "currency manipulator". Meanwhile, back in the states, the Refco (RFX chart) plot keeps thickening. It now looks like Goldman Sachs (GS chart), Bank of America (BAC chart), and Grant Thornton may get dragged into the mess, and the smoke is far from clearing. And bond yields keep creeping higher as the yield curve is getting flatter.

Maybe this is all much ado about nothing, but the market seems to indicate otherwise: the nasdaq composite is already down about 7% from its high in August, but it really hasn't broken its intermediate up-trend until a week or two ago. This is why over the past week I've changed tactics from hedging a lot of long positions with a large short position in the QQQQ, to hedging a lot of short positions including the QQQQ with only a couple of long positions that are still technically healthy. The nasdaq still has long-term support near 2000, but if that price level is broken, the market will have confirmed my positioning.

I can't wait to see what Bill Cara has to say in his week in review today. His commentary this past week has been timely and informative. I can't recommend his blog enough to anybody who hasn't seen it. It is great to see Bill really back into his rhythm, and I suspect it has a lot to do with him smelling blood in the water.

Friday, October 07, 2005

No Sunday post this weekend, casual market commentary

I'm going out of town for the long weekend, so I won't be making my usual Sunday night post. I am still way net short the market. I got short the QQQQ back in August when it was above $40 and I added to my position every $0.20 down for a few days. Although I have done a little bit of trading in and out over the last two months, I still have 3/4 of that original position and a little more added recently. I must admit, I started to sweat a little on Tuesday morning when the QQQQ had rallied all the way back to $39.88 and I read Monday Dan Zanger was anticipating an up-side breakout this week on the AIQ website. Turned out to be a fake-out.

I don't expect to act on any buy candidates until I can gauge the strength of the next rally. I've only got three long positions remaining right now (GIGA, GEPT, and ENTU) and I'm either flat, or just slightly underwater on all of them, but they are still technically healthy. ENTU looks the most favorable right now, as it is pulling back on light volume, making a clean upper-channel line to break out from on the daily chart. I will be quick to sell any of these positions if I see high volume pushing them under key price support levels.

I closed out SPIR at a small loss today. I was carrying it long from $10.10, rode it up to the top of its range near $11.50, and right back down. I got out because of its failure to recover the 50-day SMA today, and the large sell-off in the energy sector will likely catch up to it soon. It helps to look at other similar stocks. DSTI is also a solar play. I mentioned last week that I sold my DSTI position for a loss at $12.50. My average cost was $13.50, making my loss about 7.5%. Today DSTI closed at $10.92, 13% lower than where I cut my loss, and 19% lower than my original entry point. This serves as a good reminder why it is so important to cut losses without hesitation when you are trading in these volatile stocks.

So my plan? Basically to sit tight and manage what I'm carrying. If this selloff gets real nasty, it should be pretty easy to pick out some great short-sale candidates. But the long-term trend is still up for the time being, so I don't feel rushed trying to find more shorts. Besides, the naz still in a range. I read a great quote from my favorite Market Wizard Ed Seykota in Michael Covel's book, Trend Following, last night: "To avoid whipsaws, stop trading." Timely advice, because I know a lot of people are stopping out all over the place right now.

Monday, October 03, 2005

Watch list for week of 10-3-05

The market appears to be in a contracting range and not trending right now. When the market isn't trending, most stocks won't be trending. There has been more negative action than positive action on my watch list from last week which is a big red flag to me. Here are the best low-risk buy candidates from my market homework software this weekend:



I've been going through a tougher than normal losing streak this past month. I can trace it back to the first hurricane, when the market started going higher. To summarize my strategy, I basically buy explosive nasdaq stocks from the lists produced by my market homework software, and offsetting my risk during nasdaq downtrends by being short larger blocks of QQQQ and cutting positions that are no longer technically healthy. Well when this first hurricane hit, the speculative money seems to have dried up for the time being, but the nasdaq composite hasn't gone down! I've been getting whacked on both sides this month, and as a cautionary measure I have much less market exposure than I had at the beginning of the month. The last time I can remember the market behaving this way was December of last year. The hot-money stocks were blowing up left and right but the naz kept grinding higher, until the January blowout. I went heavily short in January and didn't buy another stock until April. It wouldn't suprise me to see the next few months play out similarly. This time I am already way net-short after taking losses on quite a few longs, but I may be too early and decide to trim back some next week.

I tried to buy the breakout in LONG this week, and exited the trade with a loss the same day. It was evident that it wasn't going to follow through. I've been talking about DSTI a lot on here lately, and I'm no longer carrying a position in that stock. As it violated support at $12.50, I scaled completely out of the position. I may have sold at the bottom, it happens sometimes, but the first loss is the best loss! If you can't take small losses, you will take big ones and I'm not really into doing that =D

So what is in store for next week? I'll be monitoring the health of my current positions and the ones on the list above. Maybe we'll see the market break out from its range, but I think it is too early to expect that. I don't think this is a good time to be very busy as a trader, but when you stop paying attention to the market, your positions, and emerging opportunities, you are basically dead meat. In this business it's the steady players who bring home the bacon. If you are inconsistent in applying your strategy, you may miss the small handful of trades that makes it profitable that year. This blog has helped me maintain that discipline and I'm grateful for all the interesting people I've met because of it.