|
Stock Trader and
Economy Student
J.P. Janssen's website.
The purpose of the site is to discuss ideas and principles about markets.
More
|

|
Mar/11/2008
Visualizing the Market
Vision is definitively one of the greatest wonders of evolution. By censoring some electromagnetic radiation, an animal will get a good sense of its surroundings. The visible light is just a small part of the electromagnetic spectrum, but it does make one easily spot solids as they reflect characteristic light, while the gasses in the atmosphere does not. To distinguish different kinds of solids, color vision comes in very handy. Most humans can see all the colors of the rainbow, from red to violet. Certain species can even sense shorter wavelengths; ultraviolet light. Another feature, common for predators, is depth vision. Two eyes looking at the same object from a slight different reference point gives the input the brain needs for calculating distances. And it's important to remember that the brain's processing of the eyes' input is what makes up vision.
Have a Look at the Market
As everyone knows, it is much easier to see what is going in the market by looking at graphs than on the trade data. However, what I want to discuss here:
- Vision gives an extremely important understanding of the surroundings. It uses some of the electromagnetic radiation emitted from the molecules which are in a direct line to the eye. What can we learn from vision in the process of visualizing markets?
- How can we best use the features of our vision to develop the most informative graphs (or other visualizations of the markets)?
The Computer is the Brain
In elementary school, kids learn to draw graphs. A table with corresponding x and y values are plotted into a diagram, and a simple visualization is created. With computers a lot more complicated graphs can be made, as the Mandelbrot set is an impressive example of.
A dilemma evolution faces is to chose the quality of vision versus reaction times. The same applies in my trading programs, where I want to generate graphs in real time but still not exclude important information. Both Mother Nature and a computer programmer have ways to deal with this. Instinctively your attention is drawn to moving objects. At the exact moment of writing this I spot a flying crow about sixty meters away. The reason is that I have a window behind the monitor and thus was the crow only some degrees above the text I was writing. When it comes to a my trading programs; often too much data needs to be processed for the real time generation of graphs. A possible solution is to compromise the raw data beforehand. I'll come back to this.
See More Details
Another aspect of vision is the eyes' ability to observe the electromagnetic radiation. The equivalent of the signals from the eyes to the brain, must the data input to the computer. I think there is a lot of potential for improvements here. Typically a technical analyst uses data in the Yahoo format, i.e. Date-Open-High-Low-Close-Volume-Adj Close. No matter how good the processing is, some info is left out. If one instead use the trade-by-trade data, a better picture of the market is possible, though the processing time becomes a problem.
With the Yahoo kind of data, a candlestick graph is possible the best way of visualizing the data. I guess you are familiar with this kind of graph, and I'll just mention that this makes use of all the Yahoo info (except for no distinction between close/adj close.) Some loss of date is unavailable though; with a graph being x pixels wide, a stick has the width of n pixels and the number of days d - if dn > x then two or more days must be merged. Maybe not a too big thing, but just worth mentioning.
With raw data, I'm suggesting another more informative and easier to read kind of graph. Each trade corresponds to one dot in the graph. However, this has several problems; saving all the data takes up a lot of storage space, and processing the data may be time consuming.
To deal with this problem a one-time compressing of the raw data can be made. If all trades are plotted, then a lot of information is lost due to several trades being at the same price and around the same time. The way of compressing the raw data is this:
- Find the practical time period:
With a graph x pixels wide, the dots being n pixels and a time period T is to be graphed, then a period length p should follow the equation p = Tn / x.
For instance would a small 100 pixel wide one-day graph in a market open 28,800 seconds (8 hours) and 2 pixel dots, be divided into 576 seconds (9min 36sec) intervals.
- Find each price in the period:
For each traded price in the time period, sum the traded volume. Do this for all periods.
The new data table will get the time and price combinations as the unique values, and volume in the third column.
Add Colors
With a moderate amount of data power can each dot get a shade, representing its volume. Low volumes should fade into the background and the higher the volume, the darker. A grey scale is useful, and colors can be used to other info you might find helpful.
What about Perspective?
It is common to use a logarithmic y-scale. However, I have not seen the same on the x-(time-)axis. The idea is to have a detailed impression of what has just happened and still be able to look far backwards.
Some Example Graphs
Last 21 days of a moderately traded stock.

A stock that crashed. See how it went from almost no trades to high volume? This can be interpreted from the number of dots, but if I'd used a color pattern it would have been spotted on the fly. Note: The gap between two horixontal lines is 2% of the lowest price.

A one day graph with some color experimentation.
|