Candlesticks — A dataviz marvel
No, this post is not about technical analysis of a stock. I am writing this to bring out the beauty of data visualization or dataviz as it’s fondly referred to in the data community.
Let’s look at an example.
As you know, stocks are traded on the exchange whenever buyers and sellers agree on a price. This could happen very frequently i.e. multiple trades in minutes or seconds. For the purpose of this example, let’s say there are tens or hundreds of trades of a stock happening at different prices in a minute.
You are an analyst interested in tracking the price of this stock over a period of time. What are your options ?
- Line chart
The simplest one. You can simply plot the price on the y-axis over days on the x-axis as shown below.
While this is good start, it only shows closing price of the stock on any given day.
The above line chart will not convey any information about intraday movements of the stock. How can we represent this additional information ?That’s where candlesticks are helpful.
The chart below is a candlestick version for the same time period.
Looks clunky isn’t it. Let’s zoom in a bit to last two weeks only (ignore the bottom bars, those are volumes not prices).
Each daily candle conveys following information about the stock price.
1.) Open/Close price — Horizontal bases of the candle
2.) High — Top wick of the candle
3.) Low — Bottom wick of the candle
4. Note that, color has been used as an additional dimension to indicate whether stock closed higher than its open price (Green) or vice versa (Red). This means, for Green candles lower horizontal base of the candle is the Open price and upper horizontal base is the Close price (vice-versa for Red).
While the above example shows candlesticks by day, they can be plotted by hours or even minutes.
Candlesticks patterns are used by traders to understand demand, supply and price discovery of a stock. Traders take positions based on these patterns (which is beyond the scope of this discussion).
The takeaway is, there are elegant ways of representing high velocity data by overlaying them into existing visualization options like line charts. Candlesticks are just an example.
What do you think ?