-
Notifications
You must be signed in to change notification settings - Fork 61
Description
The following are suggestions regarding the candlestick chart input and looks
Input
The following input should be specified at the chart level (not for each candle)
- Symbol
- Timeframe
The timeframe is particularly important because one needs to know if there are candles missing (when there was no market activity e.g. over a weekend or a holiday) and the chart itself may choose to present those as the so called flat (or empty) bars/candles. Those are typically just horizontal lines as wide as the candle body + border and they inherit the value of the preceding close (so they look as a sequence of dashes). Unfortunately, very few charting tools support this but it's a very useful feature because without it the time axis has missing chunks in it and any time-dependent indicator (e.g. trendlines) is therefore distorted.
Timeframe is typically specified as a positive integer. Seconds or minutes can be used for units. If using minutes, a daily chart would be 1440, a weekly 10080 and monthly would be approximated at 43200.
Colors
- background
- foreground (axis color)
- bull candle body
- bear candle body
- shadows and body border (a single color is enough for these)
Candle "shadows" are the vertical lines outside the body i.e. high - max( open, close) and min( open, close) - low.
Width and spacing
For the width and spacing I believe it's best to try to get as close as possible to how they are presented on the MT4 platform (which in my view, still has the best UI despite all other "professional" platforms out there).
As a reference MT4 has 6 zoom levels each featuring its own candle/bar width and spacing:
- (fully zoomed out) candles are presented as single color (border color) vertical lines from high to low, without any spacing between them
- same as 1 but with single pixel spacing
- body width: 1 pixel + border, spacing: 1 pixel
- body width: 3 pixels + border, spacing: 3 pixels
- body width: 9 pixels + border, spacing: 5 pixels
- (fully zoomed in) body width: 23 pixels + border, spacing: 7 pixels
Body and shadow lines are always 1 pixel wide.
Note that the zoom levels 1 and 2 typically assume the border color and not the bull/bear body color, so if choosing to support coloring them according to their bull/bear body direction then it's best to make it optional (a sequence of bull color/bear color vertical lines has little informative value but the changes in colors make it more difficult to see the big picture).
Optimizations
-
Add support for flat (empty) bars and missing shadows in general (no need to plot them if they're not visible)
-
Add support for displaying just vertical lines (high - low) when zoomed out (again, no need to show the body if not visible)