Saturday, June 20, 2009

Getting AC3 Pass Through Working in Linux

This guide is about sending AC3 stream (Dolby Digital or DTS) to a receiver when playing a video file in Linux, and have the receiver doing the decoding rather than Linux.

Issues

Linux movie players require a sound backend to play. There are two main flavors of sound backend, gstreamer and xine. Unfortunately the AC3 pass through capability is broken in gstreamer. So we need to use xine. Thus the choice of the correct movie player becomes critical if you want AC3 pass through. Adding in the complexity of ALSA, setting up AC3 pass through in Linux is non trivial.

Approach

I am going to use totem-xine for movie playback, and set totem-xine to use ALSA with AC3 pass through.

My Setup

My PC has two sound cards, the on board sound card and a M-Audio Revolution 5.1. The connection to the receiver is on the M-Audio.

Linux distro I am using is Ubuntu 9.04. Aside from getting totem-xine, the instructions should apply to all distros.

Step 0: Preparation

You should have the following files for testing purpose:
  • a video file that has a Dolby Digital or DTS track
  • a .wav file
Your receiver should already be connected to your sound card using coax or toslink cable.

You should know how to open a text terminal and edit text files using application such as gedit.

Step 1: Obtaining totem-xine

I am going to use totem-xine in this guide. Totem-xine is identical to the default movie player except totem-xine uses xine as the sound backend.

To obtain totem-xine, open a text terminal, type:
sudo apt-get install totem-xine
After you install totem-xine, if you right click on a video file, and choose Open With, you should see Movie Player (xine) as a valid choice. Movie Player (xine) is totem-xine.

If you use totem-xine to play a movie, chances are you can hear the sound from the default sound card, but not in Dolby Digital or DTS.

Step 2: Locating the Correct Sound Device

In this step, we will locate the sound device where sound is being sent from your PC to your receiver.

Note that we are using ALSA here. ALSA is the default API for sound drivers in Linux.

In a text terminal, type:
aplay -L
This command will list all the audio devices that are controlled by ALSA. In my computer, the command produces:
front:CARD=NVidia,DEV=0
HDA NVidia, ALC662 Analog
Front speakers
surround40:CARD=NVidia,DEV=0
HDA NVidia, ALC662 Analog
4.0 Surround output to Front and Rear speakers
....
The output of the command is the name of each device, followed by a few lines of its description. You should look for an S/PDIF output device that belongs to the sound card of your choice, i.e. the connection from your sound card to the receiver.

One of the device listed in my setup is:
iec958:CARD=Revolution51,DEV=0
M Audio Revolution-5.1, ICE1724
IEC958 (S/PDIF) Digital Audio Output
This is the audio device I am looking for: iec958:CARD=Revolution51,DEV=0.

Use the .wav file to test the device. In the terminal, type:
aplay --device=your_device sound.wav
Using my setup as example, it is:
aplay --device=iec958:CARD=Revolution51,DEV=0 sound.wav
You should hear some sound from your receiver. If not, you have selected the wrong device and should look for another device.

Step 3: Configuring totem-xine

In this step, we are gonna configure totem-xine to do AC3 pass through on the correct sound output device. Unfortunately, totem-xine's user interface is not flexible enough to do what we want. We will need to edit its config file.

Here is where totem-xine's config file is located:
your home directory/.config/totem/xine-config
You should make a backup copy of xine-config in case you made a mistake.

Use your favorite text editor to edit xine-config, look for the line:
#audio.driver:auto
Change it to:
audio.drive:alsa
Look for the line:
audio.output.speaker_arrangement:Pass Through
Make sure the speaker arrangement is set to Pass Through.

Save the config file. Open a video file using totem-xine and exit right away. This step is crucial because it produces extra lines in the config file for further editing.

Open the totem-xine config file again, look for the line:
audio.device.alsa_front_device:default
Change it to:
audio.device.alsa_front_device:iec958:CARD=Revolution51,DEV=0
Note: iec958:CARD=Revolution51,DEV=0 is the sound device in my setup. You should change it to your sound device found in the previous step.

Look for the line:
#audio.device.alsa_passthrough_device:iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
Change it to:
audio.device.alsa_passthrough_device:iec958:CARD=Revolution51,DEV=0
Save the config file. You are now all set. When you play a video file in totem-xine, AC3 pass through should work.

Monday, June 1, 2009

It's Not Linux's Fault, But... (Part 2 - Sound)

In this second part of the "It's Not Linux's Fault, But..." series, I am going to talk about my experience with Ubuntu 9.04 when it comes to sound and music.

First of all, let me briefly describe my PC. It's a fair typical PC with on board sound connected to computer speakers, and I have an M-Audio sound card that is connected to my stereo receiver. So the ideal setup for me is to play music through the M-Audio sound card, while the normal PC sound effect goes through the on board. This is basically how I set up sound in Gnome (Gnome is Ubuntu's desktop environment, and I prefer it over the alternative KDE).

I use Foobar as my music player in Windows. So the first thing I did was to look for a music player. After some research, I found that Amarok seemed to be the best music player on Ubuntu. I gave it a try and I liked it. Unfortunately, Amarok is a KDE application, and it ignored the sound device preference I have set in Gnome and played music to my PC speakers. I could not find any sound device preference in Amarok to make Amarok played music to my receiver.

Upon some investigation, I found that Amarok use a backend call Phonon for music playback, and there is no simple way to configure Phonon in Gnome. After some googling, I noticed that the Amarok 2.1 beta has sound device configuration, so I downloaded it (along with zillion KDE related things). The sound device configuration was there in the beta, I can play test sound to my M-Audio sound card, but alas, Amarok still ignores the setting. At this point I gave up on Amarok.

Right now I am resorting to using Rythmbox (Gnome's music player). Rythmbox sounds kind of flat to me, inferior to what I used to from Foobar. Like anything audio, this problem could very well be psychological, but I have nothing to compare Rythmbox's sound to.

My next task is to find a tool to rip CD. I need something more sophisticated than the built-in CD ripper. Specially, I need a program that can read CD multiple times to reduce error, which the built-in CD ripper won't do. Instead of hunting down another application, I found that my Windows CD ripping program Exact Audio Copy runs fine in Wine (Linux's Windows API implementation) so I just used that. Yippe, it worked.

Sound track tagging is another matter. Again I have a specific need. I need the tagging program to be able to import tags from a text file, and applies the tags to the music files. I tried using EasyTag (Linux tagging program), but I am unable to find a way to read text files in EasyTag.

Back to using Windows program again. Mp3Tag (another Windows program) can read tags from text file, it runs in Wine, except the Unicode characters are broken. So for any music track that have non-roman characters in its tag, I have to resort to entering it manually using EasyTag.

Skype works, but again, not right out of the box. In fact, I had to spend a couple of hours to figure out how it works.

I had two issues that prevented me from using Skype. The first issue is by default, Ubuntu assigns my mic input to the jack at the back of my computer. Like most people, I plug my headset into the front jack. The solution is to use alsamixer (runs in terminal) to assign the input source to front mic. Then I had to use the Gnome Sound Recorder application to test the mic.

The second issue is by default, Skype's default sound device setting does not work for me. In Skype's menu, there are three sound device assignments (Sound In, Sound Out and Ringing). Each can be assigned to one of the available 14 sound devices.

The solution was to first assign Sound Out and Ringing to pulse (Gnome's sound engine), then use trial and error to find out which sound device works for Sound in.

By the way, Skype also tend to mess up the mixer setting, causing the mic input level to be too low. There is a setting to turn this off when you assign sound devices in Skype.

I need to make calls using Skype. If Skype does not work, I simple am not going to use Ubuntu on my desktop.

(to be continue...)

It's Not Linux's Fault, But... (Part 1 - Installation)

Ubuntu 9.04 is very cool. With Compiz Fusion installed, the desktop experience is down right amazing.

Yet, to get there, I have to spend a lot of time installing things and tweaking my system and at the end of the day, a lot of what I consider essential applications are still not working.

To be fair, a lot of my problems are not Linux's fault. Usually, it is an application or a piece of hardware that does not have native Linux support by their vendor. There is very little the Linux developers can do about it.

However, whether the problem is a geniune Linux problem or a vendor problem is beside the point. For most users, they are not going to distinguish the differences. What counts is the total experience, and if my experience with desktop Linux is typical, I am afraid that desktop Linux is never going to be mainstream.

This is the first part of a 3 part series documenting my installation of Ubuntu 9.04 as my desktop OS.

I am quite familiar with Linux, using it mostly for small server setups. Recently I decided to give Ubuntu 9.04 a try as an desktop OS because I want to look at some available desktop OS options before upgrading to Windows 7 (my current desktop is XP).

My first trouble was Grub, the boot manager of choice of Ubuntu. Because I wanted a dual boot system, so I created a partition in my hard drive and installed Ubuntu 9.04 on it, keeping my Windows installation in another partition. After the installation, I restarted my computer. To my surprise, I was still booting into Windows. After some googling, I found that I had installed Grub in the wrong hard drive. Once I installed Grub on the correct drive, I could boot into Ubuntu, but then Grub failed to boot into Windows.

I suspect most casual users who want to give desktop Linux a try would simply give up at this point.

Apparently, the automatically generated Grub script was pointing into the wrong partition where Windows was located. I had to modify the Grub script to correct that. By the time Grub worked, 30 minutes of my life was gone.

The next challenge was my wireless network card. I had a Trendnet card. I am familiar with this card enough that I know there is no native Linux driver. So I used ndiswrapper (driver wrapper that lets Linux uses Windows networking driver) as a substitute. In the process, I have to look up the wireless chipset, find the right driver and install the driver with ndiswrapper with command lines. This time I had it easy, I am comfortable with Unix command lines, but I can imagine someone who is not will be quite turn off.

The next challenge setting up Chinese input methods. Setting up SCIM for multi-language input itself is easy enough, but the availability and quality of input methods are rather poor compared to Windows. I have no formal training in Chinese input method and relies on an rather obscure method I learned on Windows for inputting Chinese. Unfortunately, the equivalent method on Linux sucks badly. If you are not familiar with inputting with a non-Roman alphabet language, you probably have no idea what I am talking about, but take my words for it, it is so bad to a point I am in the process of modifying a Chinese input method to suit my need, and it is not a one day job.

(to be continue...)

Saturday, May 16, 2009

Wolfram Alpha is Cool

I recently encountered a new technology called Wolfram Alpha, and I think it is very cool.

So what is Wolfram Alpha? It is an answer engine. Unlike a search engine like Google, Wolfram Alpha attempts to provide straight forward and simple answer, rather than a list of web pages that may provide the answer.

For example, if I type in "hong kong population" to Wolfram Alpha, it will tell me it is 6.94 million people. If I type in "Citizen Kane", it will tell me it is a movie that is directed by Orson Welles, released in 1941. If I type in "35 + 27", it will tell me the answer is 62. If I type in "convert US $35 to hong kong dollar", it will give me $272.46. That is freaking amazing.

Obviously, Wolfram Alpha does not have all the answers in the world, but for whatever it knows, it seems to be able to find it quickly and provide a straight forward answer.

Another interesting fact is Wolfram Alpha is written using Mathematica, a symbolic computation application. This is quite different from a typical online database which is probably written using some variants of standard programming languages such as Java or php, and accessing a database behind it.

This choice of implementation is probably significant. Whatever the underlying technology is, Wolfram Alpha's logic is probably operating at a more abstract level than something that is written in a standard programming language.

Saturday, May 9, 2009

金庸小說的山中老人

金庸小說《倚天屠龍記》中有一段關於聖火令武功的來源:

謝遜道:「明教傳自波斯,這首波斯曲子跟明教有些淵源,卻不是明教的歌兒。這曲子是兩百多年前波斯一位著名的詩人峨默做的,據說波斯人個個會唱。當日我聽韓夫人唱了這歌頗受感觸,問起來歷,她曾詳細說給我聽。

「其時波斯大哲野芒設帳授徒,門下有三個傑出的弟子:峨默長於文學,尼若牟擅於政事,霍山武功精強。三人意氣相投,相互誓約,他年禍福與共,富貴不忘。後 來尼若牟青雲得意,做到教王的首相。他兩個舊友前來投奔,尼若牟請於教王,授了霍山的官職。峨默不願居官,只求一筆年金,以便靜居研習天文曆數,飲酒吟 詩。一一依從,相待甚厚。

「不料雄心勃勃,不甘久居人下,陰謀叛變。事敗後結黨據山,成為威震天下的一個宗派首領。該派專以殺人為務,名為依斯美良派,當十字軍之時,西域提起 『山中老人』霍山之名,無不心驚色變。其時西域各國君王喪生於『山中老人』手下者不計其數。韓夫人言道,極西海外有一大國,叫做英格蘭,該國國王愛德華得 罪了山中老人,被他遣人行刺,國王身中毒刃,幸得王后捨身救夫,吸去傷口中毒液,國王方得不死。霍山不顧舊日恩義,更遣人刺殺波斯首相尼若牟。首相臨死時 口吟峨默詩句,便是這兩句『來如流水兮逝如風,不知何處來兮何所終』了。韓夫人又道,後來『山中老人』一派武功為波斯明教中人習得。波斯三使武功詭異古 怪,料想便出於這山中老人。」

究竟這故事來源何處?峨默,尼若牟,霍山,又是何許人呢?

用google一查,找到了這網頁:
http://www.gamez.com.tw/archive/tid-116977.html

此網頁解釋了山中老人和尼若牟的來源。山中老人有可能是哈桑·伊本·薩巴,而尼若牟即是尼扎木.穆勒克。歷史上都有其人。

開始有趣了,想進一步調查。上述網頁中的人物只有中文譯名,開始有點難查。於是決定先找找尼扎木.穆勒克的英文名。不難查,是Nizam al—Mulk。

再用wikipedia查Nizam al—Mulk,找到以下文章:
http://en.wikipedia.org/wiki/Nizam_al-Mulk

其中一段很有趣:
"This account is particularly interesting in light of a possibly apocryphal story recounted by Jorge Luis Borges. In this story a pact is formed between a young Nizam ul-Mulk (at that time known as Abdul Khassem) and his two friends, Omar Khayyam and Hassan-i-Sabah. Their agreement stated that if one should rise to prominence, that they would help the other two to do likewise. Nizam ul-Mulk was the first to do this when he was appointed vizier to the sultan Alp Arslan. To fulfill the pact he offered both friends positions of rank within the court. Omar refused the offer, asking instead to be given the means to continue his studies indefinitely. This Nizam did, as well as building him an observatory. Although Hassan, unlike Omar, decided to accept the appointment offered to him, he was forced to flee after plotting to dispose Nizam as vizier. Subsequently, Hassan came upon and conquered the fortress of Alamut, from where he established the Assassins."

這不就是金庸的山中老人故事嗎?

峨默(Omar Khayyam),尼若牟(Nizam ul-Mulk),霍山(Hassan-i-Sabah)出來了。三個都是真有其人。至於三人師兄弟關係,Jorge Luis Borges是根據The Three Schoolmates的傳說來寫的。可能這傳說太吸引,金庸和Borges都使用了。

註: 山中老人霍山的Assassins組織,正是英語中殺手(assassin), 行刺(assassination)的來源。

Wednesday, March 25, 2009

[Analysis] ES analysis for March 26, 2009

We are dealing with an awkward situation here. ES was appearing to break the uptrend, dropping to below 790 in afternoon trading. Yet within 30 minutes of closing, it recoup all the losses and went back to 810 level.

Let's analysis the price movement from an intraday standpoint first. When I look at a 5-minute chart, it tells me the following:
  • The market is still sensitive to bad news. The poor treasury sales is enough to trigger a drop to wipe out the gains created by two days of positive news.
  • The last minutes rally is clearly a short covering rally. The short sellers are not committed. At below 790, they rather take the profit and run.
To me, the strong drop in early afternoon indicates that the buyers do not consider stocks cheap when ES is above 800. It is hard to tell what price the market considers stocks are good value, but longing above 800 sounds not like a good strategy unless more economic data suggests otherwise.

The bears' reaction is easier to understand. GDP and Jobless claim numbers are to be announced on Thursday at 8:30 in the morning. There is no need to fight these data.

This makes Thursday's economic data and price action are extremely critical in determining which direction ES is heading.

The market has been receiving a series of good news lately. The current ES price level seems to indicate that it is expecting more good news to come. So unless the economic data is exceedingly good, ES cannot justify at current price level and will eventually drop. Remember, today's price action tells us that the buyers do not consider ES above 800 cheap.

Trading plan:
  • Prepare to short after 8:30 data. Interpret the data first.
  • Spikes that push ES close to 820 are good shorting opportunity. Either use long put or prepare to cut loss should ES breaks 830. Ideally, short at around 9:30-10:00.
  • If economic data is so-so or bad, after 8:30, ES will likely drops. In which case, look for intraday rebound to short.
Position: None

[Position Update] Short Call Covered

Today I covered my ES 820 short call at 21 - 12 points profit.

I was unable to trade according to my own plan because my ideal long price (795) was not reached until late into the trading session. I was expecting an early morning pullback, but instead I had to trade with a morning rise and sharp afternoon drop.

I've only scalped with YM today.

Position: None

Tuesday, March 24, 2009

[Analysis] ES analysis for March 25, 2009

Let's consider the facts:
  • ES has broken 800 level and close above.
  • First retracement has happened.
Everything is pointing to a continuation of uptrend. So the natural tendency is to go long. The unknown factor here is the overnight reaction in Asia and Europe. So let's assume there is some noise introduced during the overnight session.

Let's consider our assumptions:
  • Uptrend.
  • Second retracement point at 790.
  • Uptrend broken if ES breaks and stay below 790.
  • Conservative target 815
  • Aggressive target 830
The key is to translate the fact and assumption into a trading plan.

Ideally, I should take advantage of the overnight noise to gain a good entry price for the long. It is unlikely that the second retracement point can be reached in the overnight session. So if I want to go long, a good price would be below 800 so in case of stopping out, the loss will be minimal.

Here is the trading plan:
  1. Overnight long order at 795.
  2. If order filled before market open, look for chance to double position if 800 can be broken again.
  3. If not filled before market open, look for chance to long on intraday retracement.
  4. If holding 2 contracts, use 815 to exit 1 contract.
  5. If holding 1 contract, decide whether to ride the full trend.
  6. If holding 2 contracts and break below 795, consider cutting 1 contract.
  7. If holding 1 contracts and break below 790, consider stop loss.

[Position Update] First Retracement Point Reached

ES did not reached the first retracement point (801.25) until almost closing. I am hesitate to initiate a long position near market close.

As for trading today, after I close out the short term short position, I only scalp using YM. As for the short call, the profit is getting attractive and I am tempted to cover the position if I can buy at 21 tomorrow.

Positions: -1 ES 810 Call (33)

Update: ES Scalping Covered

My 2 ES shorts are covered at 808 and 811.25. They have met their objective.

Now waiting for the first replacement point I talked about to go long (low 800's).

Positions: -1 ES 810 Call (33)

Monday, March 23, 2009

Analyzing this Rally

The current ES uptrend is much stronger than I anticipated. Recalled earlier I was expecting ES could start retracing at 750 level. But first meaningful retracement did not happen until ES touched 800.

One can argue all day that this rally will not last, because it is ignited by government rescue plans. But the fact is the uptrend is very strong. Anyone who short in the past month who did not take profit has seen their profit wiped out.

The important thing now is how should one handle this rally? Let's observe the following facts:
  • The market is significant overbought in the short term. My estimate is the overbought signal is at least twice as strong as other overbought signals I've seen in months.
  • ES has broken the 800 psychological barrier.
  • This rally is an extension to an rather strong rally, breaking an attempt to the downside last Friday.
It is quite obvious now the 820 level will be broken in the medium term. However, due to overbought situation, this is the wrong time to enter a longer term long.

The first buying opportunity would be after the first retracement. It would be a mistake to use previous price or moving average to estimate where the retracement would go. Because ES has broken the 800 barrier, I can count on the first retracement will not reach the 800 level. Any price near 800 in the new few days is a long opportunity.

More interesting is the eventual down draft. This will likely be the entry point for a long term long. I will use that opportunity to buy stocks, not futures. Rough estimate is the 790 level, but it is too early to tell.

I am currently take a bet on a retrace to the downside before the rally can continue, and I do not mind holding it for a few days. However if a retracement does not materialize, I will have to cut the positions.

Positions: -2 June ES (810.25, 812.50), -1 ES 810 Call (33)

Quick Update: Shorted covered with profit but taken by surprise

On Friday I covered the ES short at 768.75. Profitable but not that great. I was expecting an intraday retrace to the upside before reaching the 761 target, but I never managed to get back on the short.

Since 761 target was reached. I put in an order to short at 773.50, expecting the down trend to continue.

My short was eventually filled at around 8:30pm Sunday night. Unfortunately, the market got driven by the news of US government buying bad assets. I eventually have to cut loss at 785.50.

Since this is pretty much a news shock, my money has stayed on side line for much of the day. Near end of the day, I initiated new short positions, betting on over buying retracement:
  • -1 June ES, entry 810.25.
  • -1 June ES, entry 812.50.
  • -1 April ES 810 call, entry 33.
I expect to cover at least 1-2 ES contracts in the coming days. The short call I will let it sit for a bit.

Positions: -2 June ES (810.25, 812.50), -1 ES 810 Call (33)

Thursday, March 19, 2009

Sign of Turning Tides

The June ES contract closed at 780 today. I consider this is a sign of possible turning to a down trend.

My reasons:
  1. ES has made a double top at the 800 level.
  2. There is no meaningful retracement to the upside during the day. This is a very clear sign the longs are taking profit.
  3. After hour, it has dipped a little below 780, a level I considered important.
  4. The up move yesterday was caused by a Fed decision to increase money supply, not a change in company profitability.
This has give me confidence in keeping my current ES short. I have confidence that ES will test the 760 level or below in a couple of days.

Friday is option and futures expiration day. Because the chart formation is pretty clear now, option expiration is only adding noise to the chart and may be delaying the drop to next week.

Friday's trading plan is as follows:
  1. Maintain ES target at 761. If 761 is reached before market open, take it and short again after market open.
  2. If 761 is reached after market open, re-short decision will be based on intraday pattern.
  3. If 761 is never reached, but ES does not rise in significant way, add one more short near market close.
  4. If 761 is never reached, but ES turn around and stay above 800, cut loss.
At current price level and chart pattern, it does not make sense to initiate any longer term long position, unless ES drops below 760 and shows a promising turn around.

Thursday trading: I did some scalping using the YM contract, not touching the ES contract.

Position: -1 June ES

Forgot FOMC meeting

This is as embarrassing as it can get for a trader. I totally forgot Wednesday's FOMC meeting.

I entered a scalping/semi-positional short entry and watched it get filled and then run into deep losses.

Lesson learned.

As for Thursday, I am not considering entering any long position. The market is in significant over bought state. This does not mean a correction will start. In fact, chances are, I am more likely to win by going long. However, should a correction happens, it will run relatively deep. Thus, while going long has better chance to win, the reward does not justify the risk.

Because I already has one ES short, I will not add more to my position. I may do some scalping, but that's it for now.

Position: -1 June ES

Tuesday, March 17, 2009

Sometimes, it is just not going your way

June ES did not quite reach my expected low of 742. Thus I've been doing scalping long for most of the day. My entries were not very good and only manged a small profit with the scalping.

What kills me is a scalping short enter at 3:42pm. I didn't expect ES to break previous day high with only 30 minutes to go. Unfortunately it did and with a vengeance.

Now holding on a "scalping" short and what is my trading plan?

  1. The scalping short was a mistake, pure and simple. It should be cut. I am trying to do it at 744.
  2. Overbought signal has been digested. This means I do not expect another big drop within 1-2 days.
  3. Interesting enough, I believe the 770 level will be retested in the next retracement.
  4. The conclusion is to look for sell signal at 780 or above.
It is too early to talk about specific price level yet, but one possible strategy is to short ES calls at next major breakout.

Monday, March 16, 2009

Entering Short Term Sideway Market

The market is currently in retracement. However, the afternoon drop of ES is not severe enough to break the current uptrend.

So the question becomes, when is a good time to re-enter a long position.

I expect the retracement to last 1-2 days. For tomorrow, ES can either continue to go down, or be in a very choppy mood.

This means I would like to go long in the low 740 level, and expect an uptrend continuation on Wednesday or Thursday.

Despite the market will look like it is going down again tomorrow, this is exactly the wrong time to enter a longer term short postion. Trades for tomorrow should either be scalping nature, or for building up a long position. I will believe downtrend resumes only if ES breaks below the 730 level.

As for trading, the lower high created on Friday was once again broken on Monday before market open. In this situation, it is quite clear the market is unlikely to start retracing until later in the day. Thus, I cut my short position.

On the other hand, the market is severely overbought and it is quite clear a correction is just around the corner. The question is when.

I made the decision to short ES again at a much better price and ride most of the intraday retrace. The entry price is very much based on "scalper instinct" and it is hard to describe in words how I arrive to the conclusion.

Today's trading summary:
  1. Stop loss on the March ES short entered last Friday (-7 points).
  2. Scalping.
  3. Short June ES contract at 770, covered at 754 (+16 points).
Position: None.

Friday, March 13, 2009

Shorting the ES for a small retrace

Today I did nothing until 4pm. At which I short the March ES at 756.75.

This is moderately risky short term play. I am expecting a small retrace of ES back to 745 level before the uptrend can continue. Thus my target is 745.50.

At the current moment. This is no reason to enter a long term short position. Most likely, any dips will be buy back up.

Position: -1 March ES.

Thursday, March 12, 2009

Money on side line now

I waited today for 8:30 news before initiating long on ES. Unfortunately the retail sales news is better than expected. The price I got was 719 (March contract). I exited the position at 729.25, hoping for an intraday retrace to 725 to re-enter long. Alas, did not happen and I never got the chance of re-entering long.

As of 1pm, ES intraday high is 739.25. This has already meet my original objective thus the long term money will be on side line.

Scalping wise, I expect a small retrace near closing. A small short opportunity for a few points.

I also covered the ES 725 short put. The put is already in money and will be dropping slower compared to the index and the risk of holding the short put is not worth it.

The outlook for tomorrow is still positive. However, one should consider only scalping long at current price level. I see no sign of initiating longer term short yet. I will consider shorting April ES call at extreme price level.

Wednesday, March 11, 2009

ES long entry readjusted

Despite a failed intraday rally, I still believe ES is on an uptrend. I will change my view if ES drops below 705.

Trading wise, there was no overnight retracement for me to hop on the ES uptrend bandwagon. ES has been going up all night and continue into market hours, then exhibits a choppy downward movement after market open. Since I didn't get on a good price, all my trades are scalping trades for the day.

ES did one point touch 732.50, very close to what I predict as resistance yesterday (735). This happens earlier than I expected.

Current trading plan is to go long at around ES 707-713. I like to enter the position after the 8:30 retail sales data, with a 735-740 target in mind.

Positions: ES 725 SP

Tuesday, March 10, 2009

ES on uptrend?

Today's S&P 500 movement likely confirmed we are on a new uptrend for the S&P. The previous resistance, 700, has been broken and we are closing at a healthy 720 level.

This is a relatively fresh uptrend. So I do not expect a big retrace. I will be trying to enter a ES long position at 703-704 level, with a 735 target in mind. I think it is quite possible for ES to eventually reach the 750 level, but because we are in a deep bear market, I rather use 750 as a potential short entry than a long target.

Position disclosure: Short Put 725 ES.

Monday, February 23, 2009

Friday, February 13, 2009