Monday, April 27, 2009

Best Free Charts

Maoxian had a post a while ago discussing various web charting software. It had the usual run of the mill. Nothing interested me since I use, and love, Tradestation for my charting and my short term trading.

Well, today somebody left a comment mentioning a site called BestFreeCharts.com  I thought a site with such a cutesy cannot be any good but I am always curious so I visited.

Lo and Behold the charts are awesome, they are the closest thing I have ever seen to Tradestation. I know many people swear by Think or Swim, but I never liked their charting setup, some how it just did not click for me. This on the other hand felt natural right off the bat. The market is closed now, so i do not know what it will do during market hours, if it actually has real-time charting that would be amazing.

What’s even more interesting is that the site is written in Microsoft’s new technology, SilverLight. I’ve been delaying toying around with SilverLight, mainly because I am so busy with other stuff. But now I am thinking that I should start playing with it.

Sunday, April 26, 2009

More Tech less Politics

I grew up in a political house and politics is in my blood… but my intent of this blog was to muse about software mostly, and stocks and politics as fillers. Ended up spending more on the fillers than on the tech stuff.

Time to refocus and retool. No politics unless something grandiose happens…

Saturday, April 25, 2009

Weekly Wrap

For the third week in a row, the broad market index, S&P 500, finished around the 870 level without managing to break through it to the upside. It looks to me like the index by moving sideways is digesting its recent run up from the March lows in preparation for another run up to the 950 level nearing the falling 200 day moving average. While the longer term trend is down and indicates another leg down in few weeks, the current trend is up and there is no reason to fight it. The proper position for now is to be long the market with a trailing stop. The trailing stop can be as tight or wide as your tolerance allows.

 

spx

The Nasdaq composite continues to motor higher, at better than 7% up for the year, it is the strongest of all the broad domestic indexes. I am long the QLD, which is the double long ETF of the QQQQ, the Nasdaq 100 index.

 

qld

The Nasdaq’s run is steep and a little breather is in order, but just like the broader market, the current trend is up and there is no use fighting the tape.

 

My other position is in TCK. It had a huge run up but then started to consolidate for few days. Earlier this week it dipped even lower tripping all kinds of stop losses. Then some news came out about some financing deal and within a single minute the stock shot up over 30% and held its gains for the day. The volume for the day ended up being the highest ever as far as I can tell. If you read William O’neal books you know to respect the volume and I intend to. While some may view this move as an opportunity to sell, to me, it is an opportunity to buy.

tck

AIPC, as reported earlier in the week, was my largest position and got sold this week as my stop got hit. This is probably market manipulation ahead of earnings so that the big players shake out the “weak” hands like me. I’d rather be a weak hand and get shaken out than to hang on stubbornly and watch my position turn into a big loss. I intend to redeploy the money into TCK in the coming days.

Friday, April 24, 2009

Darn

aipc

The market keeps on rallying… but it rallies without me as my largest position took a hit. AIPC has dropped significantly from $35 couple of weeks ago and took out my stops today. I ended up getting horrible fills to boot and sold out at the low of the day. Some of the shares got filled at over 40 cents away from my stop price, in the middle of the day, these market makers have no shame.

It looks to me like big players are toying with the small speculators ahead of earnings. My guess is that earnings impress and AIPC runs much higher from here, but I am not going to impose my opinion on my risk management. My stops got hit and I am out of the stock… for now.

Tuesday, April 21, 2009

TCK

tck

 

This is a 1-minute chart of TCK today, showing how in a single minute, the stock moved up 30%.

How would you like to have been short that stock this morning? holly crap.

Of course, if you are reading this blog then you should’ve been on the right side of this trade and would’ve been long TCK this morning as I’ve been posting about it for ever and postulating that it will be, in my opinion, the best performing stock of 2009.

Monday, April 20, 2009

High Beta

With a high Beta Portfolio, like mine, the portfolio catches the flu when ever the market sneezes.

The market sneezed this morning and all of the sudden my components are down 15% for one and 10% for another. Ouch.

I mentioned that I will be looking to dispose the rest of my cash by buying TCK on a pull back. Well, TCK pulled back a lot today and my order was filled at the open right before TCK continued to sink further. So I got 400 shares at $8.05. As it sank, I used the remaining cash in the portfolio to add another 200 shares at $7.50. The portfolio is now pretty much fully invested with barely enough cash to buy a good dinner left in it.

Barring stops getting hit, there will no more planned trades for a while. My stops on TCK and QLD are very wide, though these two tend to make huge moves, so who knows. My stop on AIPC is the closes of all three but I am thinking AIPC will hold here.

Saturday, April 18, 2009

Weekly Wrap

Like it or hate it, the rally continues upward with small, low breadth, low volume, low volatility pull backs. This is the definition of a bull market. Whether this is a short term bull market within the context of the larger bear market, or a new bull market that ended the bear market, remains to be seen.

What matters is that the stocks are moving up in a nice regular pattern making higher highs and higher lows and allowing us to keep trailing our stops higher.

spx

The S&P 500 broke out above new multi month highs and unless is stalls at the 940 level, which was the high for the year it looks like it wants to meet the falling, yet flattening,  200 day moving average. While the strength of this rally goes counter intuitive to everything we hear about the shape of the economy, none of that matters, it is what it is, rising prices with higher highs and higher lows.

 

qld

The Nasdaq continues to be the strongest of the broad indexes, and the QLD (the leverage ETF that tracks the Nasdaq 100 index) give a buy signal in my system yesterday. That makes it the newest addition to the portfolio. The system has a very generous stop at this time at $25. This gives the position room to breath, but on the flip side means that there is room for a bigger loss if this was the end of the rally. We shall see.

 

 

aipc

AIPC remains the backbone of my portfolio. After dipping below the 50 day MA and scaring some people, it rebounded strongly to settle nicely above the average. I added to my position on this dip, also the system adjusted the stop level to Thursday’s low of $29.07.

 

 

tck

TCK is my favorite stock this year and I believe at the end of this year we will look back and find that it was the best performing stock this year. It trades off the strength in copper and it has plenty of room to run. However, I had entered it as a discretionary trade as my system did not give a buy signal for it till this past Monday. Since it was a discretionary trade I wanted to play it tight, as a result I sold some of my position into strength, I sold covered calls against another part and I set a stop too tight for the rest. As such I was going to be left without any shares at expiration yesterday. However, since my system gave an entry signal for it I decided to buy back some of the covered calls I sold against the stock for a loss. I had sold 10 covered calls (controlling 1000 shares) at $0.70 each earlier. Yesterday, I bought back 6 of those calls at $1.25. This means that 400 shares will be called away at $7.50 and I will be left with 600 shares for now.

http://spreadsheets.google.com/pub?key=pZVKBLMyPP0OOCwx7fnPEaA

 

As a result of these moves the portfolio is now made up of two common stocks, AIPC and TCK. One ETF, QLD, and one preferred stock, BAC-B. In addition to the GMAC and GM bonds.

As of this week the portfolio is down 5.5% for the year and trails both the Nasdaq and the S&P 500 but is slightly ahead of the Dow. The Nasdaq continues to show awesome strength and is ahead by 6% for the year.

Unless some of my stops get hit I have no plans for any sales this coming week. I will probably try to buy some TCK or QLD on pullbacks with the remaining cash in the portfolio.

Friday, April 17, 2009

Bought QLD

This rally is getting very extended but my system is giving buy signals all over the place. I took one of them few minutes ago and bought QLD.

Thursday, April 16, 2009

Adding on Dips

aipc

 

AIPC has been consolidating since the last earning announcement and the gap up that followed.

While it generally held the gap it has been volatile within a trading range. Today it is near the lower end of the trading range and had opened below the 50 day moving average and moved sharply lower. This is a technique used by “smart money” to shake out the weak hands as many people have their stops just below the 50 day moving average.

After noting that it recovered from its lows of the day, I decided to add to my position. The good news is that with this development my trailing stop would rise to just below today’s low starting next week.

Wednesday, April 15, 2009

TCK Stopped out

TCK dipped low enough today to stop me out at $8.48, before going back higher…

Tuesday, April 14, 2009

Greed and Fear

Yesterday I blogged about a possible option play in TCK. I was fearful for my profits and wanted to use a conservative covered call strategy for fear of the stock’s decline.

tck

 

My option play did not trigger yesterday. Today, I am being greedy instead of fearful. Seeing how the stock went down at the open and the recovered nicely I decided to add another 2000 shares to my position. My position is now over 5000 shares, with one thousand of those protected via a covered call that is now very deep in the money and will be called away in four days.

I placed a stop loss order for the rest of the position at just below today’s low. Let us see how this works out.

 

I also closed the four covered calls I had sold against AIPC couple of weeks ago. It looks like the calls will expire worthless, but I got to buy them back at $0.20 and so it is not worth risking the stock running up for some reason over the next three days and getting called away.

Monday, April 13, 2009

The 5% solution

TCK is still on a tear, up another 10% today thus far. I owned this stock for a while and sold some of it on the run up, at much cheaper prices, thinking it will come back to me, it has not. I then sold April covered calls against most of what remained, thinking I’d lock in some gains. That was a mistake as the stock keeps rallying up.

The options expire this coming Friday… so what a speculator to do? Seeing how it is still running up in good news and bad, I am tempted to buy some more. But seeing how extended it is, I am scared of buying at these prices.

So, here is what I did, I bought 2000 shares at $8.80 and I immediately placed a limit order to sell the $7.50 April calls, that expire in less than 5 days for $1.80, they are currently trading at $1.45.

If the stock continues to run up today and/or tomorrow, I should get filled at $1.80. If I do, I expect the stock to stay above $7.50 by end of week as it is showing awesome strength. My shares will then be called away at $7.50. My in take would be $7.50 + $1.80 = $9.30. My potential profit would be (9.30-8.80)/8.80 = 5.6% in five days.

It is a fairly conservative play considering the strength of this stock, but considering how far it has run up, I am more comfortable being conservative.

If on the other hand, the stock stalls here, I will not get filled on my order to sell the calls and this may turn out to be a “long term investment” :)

Sunday, April 12, 2009

The limit of Limit

MySQL has a nifty little clause called limit. When used in select statements you can limit the number of rows that come back in the result set. It has an optional parameter, offset, that lets you skip X number of rows in the result.

I love MySQL, not just because of its cost, or the fact that it is open source, or the entrepreneurial drive behind it, but because it works. I finally got sick of MS SQL Server few years ago when our application had so many deadlock problems and a consultant from Microsoft told us after a  week of going through our app that SQL Server was not meant to be used in the “this fashion”. I will spare you the details of what “this fashion” is but suffice to say it was not “dumb code” or bad architecture. It was things that should’ve just worked.

 

Any how, so I use MySQL for all my applications now, and I write plenty of hardcore applications. The amount of work and number of users I can support with a single machine is mind boggling for those used to setting up server clusters and farms to make things responsive in MS SQL or Oracle environments.

Limit is one of those MySQL clauses that I use a lot. Most often I use it to setup paging, instead of retrieving a complete result set and then looping in code to skip to the required page, like many Grid Views do by default, I just retrieve the specific set of rows in my page and have MySQL do the heavy lifting for me.

Another use of Limit is when i want to throttle processing. For example, one of my systems sends out email notifications for our work flow. We have thousands of active users on our system and thus end up with thousands of notification emails going out every day. Since our servers do so much, I throttle the emails, sending a batch every X number of minutes. There is a bunch of logic to process email priorities and retries. To throttle the emails, I just grab the top X number of emails in each queue, but using the Limit Clause.

 

If the email succeeds, then I mark the message as successful. If it fails then I retry it once, and then retry it twice, before finally deeming it as failed. This all worked well for a long time, till all of the sudden we started to realize that some important emails were not being sent out. Many of our emails are very time critical per the nature of the business. I started to look into the queue and realized that some other programmers were taking the liberty of putting regular notification messages in the highest priority queue. So I initially thought that we were just clogged with too many emails in the queue. I moved the messages to a different queue and everything ran well for a day or two, and then we started to miss important emails again.

 

Further investigation shows that it was a comedy of errors that results in this scenario. As I said, we try to send our emails couple of times before we mark it as failed. The general logic is like this:

 

Setup the Mail subject, recipient and carbon copies.

Try to send the message.

If success then mark the message as sent.

If Exception then mark the message as retry, or failed, if it had been retried multiple times.

 

All looks good to me. But why is the email system getting clogged. Turns out that somebody set up their email address in the interface by copying/pasting from another application. When he pasted, a Carriage Return character came along for the ride. So the email address was saved with a CR at the end of it.

When trying to setup the email in the code above, we setup the subject and recipients outside of the Try/Catch. So every time we setup the recipient, we had an exception because his was not a valid email address. We do a sanity check on email addresses, but a trailing CR is not one of them.

Since the exception triggers before our Try/Catch block, the email message is not marked for failure. The external calling function then catches the exception, logs it and moves on with life. But the message remains in the queue as if it has never been processed before.

Since we throttle the email processing, using the Limit clause, we only get X number of messages to process per run. When we had the first email for this person, his message kept coming back every time, and it was never processed due to the issue above, so we only got to process X-1 messages per run. When he got another message in the queue, we ended up processing X-2 per run. Every time we got X messages to process, two of them were his, they failed without being marked as so, and thus took two spots in the queue.

Eventually he had enough messages queued that all what we were getting every time was his messages. So we never processed any more emails from that queue.  When dealing with the immediate problem, I initially thought that we simply got so busy we needed a bigger queue, bigger fire hose if we will. So I upped the X dramatically and emails started to flow again.

Once the immediate problem was resolved I moved on with life. But that night, I woke up in the middle of the night with a nagging feeling. I said that the calling function was catching the exception that we failed to catch in the mail send routine and logging the exception. I saw the messages in the logs but did not realize what was going on. I just assumed that indeed we had people who put in a bad email address and forgot about it. But at night, that log file kept showing up in my dreams. I could not go to sleep and let it go.

So, I got up, fired up my computer and started going through everything with a fine comb again. And that’s where I realized what’s going on. It was not really the fault of the “limit” clause, which had served us very well thus far in scheduling our resources. It was a combination of things that got together at the “perfect time” and caused a perfect storm. Or, a Murphy’s Law moment as I like to call them.

 

We missed few emails, but we had managed to use a band-aid for the immediate problem, and then we had the real fix in within 12 hours. Now I sanitize the email addresses more vigilantly and we put the whole email setup in the inner Try/Catch block. If the message fails for any reason, we mark it as so, and do not let it clog our system.

 

This sort of thing happens all the time. In the worlds of Speculating, dumb people call it a Six Sigma event, or more recently A Black Swan event. What they try to say is that, per their analysis, such a thing would happen only once every million years. They were so unlucky that this once happened on their watch and thus their Hedge Fund blew up, or their CDS portfolio crashed.

Truth of the matter is, in programming, much like in speculating, there are no Black Swans. There are no Six Sigma Events. These things happen all the time. You can either understand that, take responsibility and manage your risk. Or you can destroy other people’s fortunes and lose Other People’s Money because you refused to manage risk and instead blame the occurrence on a once in a million years event.

 

Most people that read Taleb’s books, The Black Swan, and Fooled By Randomness, completely and utterly miss the points of his books. I am sure he finds it humorous that so many people waste their time reading his books yet completely missing the point. Most people believe Taleb is talking about Black Swan Events. They do not realize that he is telling us that all those events that we mismanaged risk for were NOT BLACK SWANS. His point is that we let ordinary, and even frequent, events crash us completely due to lack of proper risk management. He is not describing Black Swans… He is pointing out that these events are indeed not black swans.

Friday, April 10, 2009

Weekly Wrap

http://spreadsheets.google.com/pub?key=pZVKBLMyPP0OOCwx7fnPEaA

 

 

They say, never confuse a bull market with brains. We have been in a “bull market” for the last few weeks and many portfolios, including mine, have been buoyed by this run. We all of course think that we are investing geniuses because are portfolios are worth more on paper than they did five weeks ago.

Bear markets are known for bear market rallies. The sharper the rise the sharper the fall. One day, we will have a bear market rally that turns to be the real thing, this may be it, but I doubt it. Lots of people believe in V bottoms, W bottoms and all kinds of bottoms. I personally believe that true bull markets, whether in stocks or in indexes, start off sound bases. Which is not what we have today and thus I expect this rally to end sooner rather than later. When it does, we will pretty much have two options, either we pierce the March lows and continue our vicious bear market. Or we retrace a substantial percentage of this run up, put in a higher low, and the continue side-ways and higher from here, with March lows being the ultimate lows for this bear market. That’s the most likely scenario in my opinion.

However it plays out, capital preservation is key, and thus I intend to keep my stops in, and play defense with covered calls and cash, and  scale out on big run ups. As things stand I have about 25% of the portfolio in cash. I have covered calls against the majority of my TCK position and some of my AIPC position. The calls expire in a week, the TCK calls are in the money, the AIPC calls are not.

I’d like to buy more TCK and BAC-B on pull backs, but I do not mind waiting for the pull back to happen. I’d rather the cash burn a hole in my pocket than watch the portfolio dither away.

The portfolio is now down just over 3% for the year. Not bad considering the bad trades to open the year. It is ahead of the broad market but badly trails the Nasdaq composite which is positive for the year.

tck

TCK looks very strong, with plenty of room to run on the upside, and is benefiting from the rise in copper prices. None the less, its recent rapid rise gives me pause, especially considering the bear market we have endured over the past two years. That’s why I selling covered calls, selling on run ups, and waiting for pull backs to add to my position.

 

aipc

AIPC is just gorgeous. I love this chart. Builds a base and jumps up, builds another base and jumps up. Earnings are coming up and it should be interesting, it could go both ways. Either jump higher on earnings, or dive 50% over night. I am keeping my stops intact at $26.65, we shall see. I am thinking this baby has a lot more room to grow.

 

 

 

spx

The broader market looks like it wants to go up to the falling 200 day moving average, which may become the most powerful bear market rally of all time. If it does, we will be near or in May. The old Wall St. adage says: “Sell in May and go Away”… if we ramp up to the 950-1000 level and you do not sell some of your holdings then do not blame anybody but yourself. The next few weeks should be interesting.

Thursday, April 9, 2009

All my Options

With the stock market continuing its strong bear market rally I did not have a chance to buy back the TCK and BAC-B shares I recently sold. I sold them on strength, hoping to buy back on a pull back, but neither of them pulled back and continue to rocket higher.

Today TCK gapped up and is currently trading around $7.70. Up over 50% in the past several sessions. So I am torn between selling the rest of my position, hoping to buy back on a pullback that may not happen, or holding on and risking a hideous end as the market tanks.

Finally, I decided to keep the position but sell covered calls against most of it. The April options expire in eight days. I sold the April $7.50 calls for $0.70 this morning. Meaning, if the stock holds $7.50 for the next eight days it would be called away and I would have synthetically sold it at $8.20 by next Friday. Not too bad. Though with my luck it will be $15 by next week and I would’ve lose on much more upside than what I locked in.

Alternatively, if the stock pulls back and closes below $7.50 by end of day next Friday, then the options would expire worthless, I would keep my $0.70 and I would keep the stock.

This bear market rally pauses lots of challenge as the natural reaction is to short this strength. However as long as the strength continues, I will continue to ride the trend and use trailing stops and covered calls to lock in my gains.

Friday, April 3, 2009

Weekly Wrap

spx

Wow. After talking out the falling 50 day moving average the market consolidated a tad and today took out the flattening 100 day moving average. Shrugging off horrible unemployment news in the interim. The latest reason for the euphoria is the FASB decision to allow banks to mark their worthless assets to model myth.

The veracity of the rally coupled with the bad news confirms that this is merely a bear market rally. Bear market or Bull market, the market is rallying and it does not make sense to stand in its way. The next levels up for the S&P 500 look to be the congestion around 900 and then the 200 day moving average, currently around 1000.

As difficult as it is to imagine, it is very likely that the market will continue to move up to take reach those levels. Whether you believe the market should go lower or should go higher, the prudent thing to do is to realize that it is indeed going higher, for now, and just ride the wave.

The Nasdaq composite looks even stronger than the S&P 500, and indeed it is even positive for the year.

So while I think this rally will end up badly, I am of the opinion that it has more room to go.

 

The portfolio is down near 8% for the year, now falling behind the S&P 500 and the Nadsaq but slightly ahead of the Dow.

After the recent run up I trimmed back on some of my positions but it looks like I may have moved too early as it seems this rally is going to keep going.

I have open buy orders to buy back some TCK and some BAC-B on pull backs.

AIPC is still consolidating above the 50 day moving average, and while it is volatile and can shake out some weak hands, I am enjoying the action as I believe it is preparing to spring higher from here. Other than that I do not have big moves planned for the portfolio.

Thursday, April 2, 2009

Trimming Back

I sold some of my TCK and BAC preferred in the last few minutes of the day after the run up we witnessed as of late. Looking to get back into the same positions at lower prices.