Transitioning to a professional website, front and back

Yes, this is still In case anyone is visiting and noticed the different design. I've made some major changes to the website over the weekend for both aesthetic and technical reasons.

  1. Professionally designed. The previous theme was something that I hacked together over a weekend. It's actually pretty bad under the hood as I had only learned PHP scripting to write that theme. This new theme is a minor tweak over a professional framework. It enables more flexibility to the page layout. Expect some major changes to the front page in the weeks to come as this personal blog transforms into a company site.
  2. Reduced computing resource hog. I disabled a number of Wordpress plugin modules as the theme has already taken care of things like search engine optimisation.
  3. Optimised page loading time. The code for the new design is also optimised for faster page load times with built-in optimisation of javascript and css file loading.
  4. Geographically distributed content delivery network. As forex is a global endeavour, the readers to this blog is quite geographically diverse. While the site is hosted in the U.S., I want to ensure the readers from Germany and India (8% of my readers) have a smooth browsing experience too. The use of a CDN to mirror contents around the world makes this possible.
  5. Bad traffic filtering. A significant traffic on the web is due to software crawlers. Some of them post spam comments on my blog or copy my copyrighted materials. I added a server-side security control service to block all those unwanted traffic. This increases security and reduces unnecessary server load.

You might have noticed that aside from point #1, which is purely aesthetic, everything else is done to improve page load time for readers to this blog. The result is that the new loading time is down to about 4.0 seconds. Whereas the old site took around 8 seconds to load. You might think this cost a fortune. But it still costs less than most small websites out there. The old site cost me \$30 per year to run, including everything from domain name registration to web hosting. The new total is still only up to \$70 per year. The key to the savings is that I made use of a free network enhancement service ( and exploited my remote server and network optimisation knowledge acquired from the long nights of administering a remote trading server. Technology is cheap nowadays. The real values are in the ability to deliver on that technology to bring about even greater return. This is what drives everything I do at Quantisan Systems.

Posted 05 April 2011 in journal.

Why use .PNG image format for stock chart captures instead of .JPG or .GIF?

If you are like me that keep a detailed trading journal in a blog or in a computer, then capturing technical analysis charts (assuming you use TA) is an essential historical record of your trades. I was saving my charts in JPG format for many years because that's also what my digital camera used. So I used it without giving much thought. It wasn't until one day when I realized my saved charts were slightly blurry that I gave the issue of image format more thought. After some research, I found out that not all image formats are created equal. Not only do they differ in compression level, they also differ in their quality and intended use. This post is intended to summarize my conclusion about why PNG format is the best for saving stock chart captures. In addition to the popular JPEG image format, I have often seen other technical analyst bloggers use GIF to post their charts. As such, I'll compare the 3 formats in this article. The criteria for judging image format for stock charts are obviously quality and file size. Quality is definitely what matters the most because stock charting relies heavily on the points and lines for comparison and analysis. If you can't figure out the resistance/support, for example, from looking at the image, then that chart couldn't provide you with in-depth analysis later. Which would render it useless for the purpose of reviewing your trades. As for file size, it depends on if you're posting it online. If that the case, then it's arguably as important as the quality of the image. Waiting for images to load is an unnecessary waste of time. Before digging deeper in this topic. I figured that it's best to just present a real case trading journal example. Here's what I did for the figures attached below. I captured a chart of crude oil futures with my trading screen. Moving averages, channels, volume, and a couple more separate indicators. A pretty typical setup. The first image is saved in JPG format. It is 213 KB in size. Click on it to see the full size image. Notice the compression artifacts. In particular, the distorted colours and pixels. You couldn't really make out some lines because it's blurred. The second image is in PNG format. It is only 68 KB in size, a 1/3 of the JPG. You can see that it's perfectly clear and sharp. If you're interested in more explanation, continue reading. But be forewarned that this could get confusing. According to Wikipedia, .PNG images are generally smaller than GIF but bigger than .JPG. However, PNG images produce sharper quality than JPG if all else remain equal. Thus, for a clear technical analysis chart image capture, PNG's file size is smaller than JPG (and GIF) if the quality and resolution (height and width) are the same. That is because PNG (and GIF) uses a lossless compression technique. Meaning that the compressed image looks exactly the same as the original. Whereas JPG uses a lossy compression technique. Meaning the compressed image is merely close enough with the original. JPG would lose out its advantage of smaller file size because it needs to increase the quality (by reducing compression rate) to keep up with the quality of PNG. And why the quality setting needs to be high for charts? Because of the high contrast and non-uniform nature of stock charts. You can rarely guess what a pixel is like from its neighbours. That is why lossless image compression is highly preferred. Out of the commonly supported trading platform export image formats out there, PNG is the best there is. PNG is also widely supported by web browsers and operating systems, so it's almost impossible that you will find a computer that can't read it. In summary, here's a ranking in terms of file size (for the same resolution and quality of image), #1 being the best:

  1. PNG
  2. GIF
  3. JPG

Then a ranking for the quality at the same resolution and file size, #1 being the best:

  1. PNG
  2. GIF
  3. JPG

(Sorry, I couldn't do a table in this blog) Also note that PNG was designed to be an improvement of GIF. So in most cases, PNG beats GIF. Lastly, there's also BMP bitmap format. Some people may use it because it's the default for Windows Paint and some other software. Although, BMP is lossless too, it has no compression at all. For example, the samples below were 213 KB and 68 KB for JPG and PNG, respectively, but the BMP file is 3,319 KB for exactly the same image! Using BMP is a waste of hard drive space for saving stock charts when you can use PNG for the same image quality. [caption id="" align="aligncenter" width="580" caption="JPG sample (213 KB)"][JPG
sample (213 KB)]JPG sample (213 KB)[/caption] [caption id="" align="aligncenter" width="580" caption="PNG sample (68 KB)"][PNG
sample (68 KB)]PNG sample (68 KB)[/caption]