Chart Types and What Each One Shows
By the end of this lesson you will be able to say exactly how much of a bar each chart style throws away, and to defend a choice of style with something better than habit. That matters because the style you look at quietly decides which questions you are capable of asking. If a chart cannot show you the range of a bar, you will not notice a wide-range day, and you will not go looking for one.
The same bars, three renderings
Section titled “The same bars, three renderings”Everything on the screen comes from the same five numbers per bar that Part 2 took apart: open, high, low, close and volume. Nothing in a chart style adds information. Each style is a decision about which of those numbers survive the drawing.
Five synthetic bars, and what a line chart keeps of them
| Bar | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
Open | 100.0 | 101.5 | 103.0 | 102.0 | 102.2 |
High | 102.0 | 104.0 | 103.4 | 103.8 | 102.6 |
Low | 99.5 | 101.0 | 100.2 | 101.6 | 99.0 |
Close | 101.5 | 103.0 | 100.6 | 102.2 | 102.4 |
Range (High - Low) | 2.5 | 3.0 | 3.2 | 2.2 | 3.6 |
Line chart draws | 101.5 | 103.0 | 100.6 | 102.2 | 102.4 |
Look at bar 5. Between its low and its high, price covered 3.6 points — the widest of the five. A line chart drawn on closes records that bar as a rise of 0.2 from the previous close. Both statements are true. They are answers to different questions.
Here are those same five bars in all three styles. Nothing has been added between one picture and the next: the only thing that changes is how many of the five numbers survive the drawing.
Rendering 1 - line, one number per bar
- Close
Show the numbers behind this chart
| Bar | Open | High | Low | Close |
|---|---|---|---|---|
| 1 | 100 | 102 | 100 | 102 |
| 2 | 102 | 104 | 101 | 103 |
| 3 | 103 | 103 | 100 | 101 |
| 4 | 102 | 104 | 102 | 102 |
| 5 | 102 | 103 | 99 | 102 |
Rendering 2 - OHLC bars, four numbers in one glyph
- Close above open
- Close below open
Show the numbers behind this chart
| Bar | Open | High | Low | Close |
|---|---|---|---|---|
| 1 | 100 | 102 | 100 | 102 |
| 2 | 102 | 104 | 101 | 103 |
| 3 | 103 | 103 | 100 | 101 |
| 4 | 102 | 104 | 102 | 102 |
| 5 | 102 | 103 | 99 | 102 |
Rendering 3 - candlesticks, the same four numbers
- Close above open
- Close below open
Show the numbers behind this chart
| Bar | Open | High | Low | Close |
|---|---|---|---|---|
| 1 | 100 | 102 | 100 | 102 |
| 2 | 102 | 104 | 101 | 103 |
| 3 | 103 | 103 | 100 | 101 |
| 4 | 102 | 104 | 102 | 102 |
| 5 | 102 | 103 | 99 | 102 |
Line charts: one number per bar
Section titled “Line charts: one number per bar”A line chart plots a single value per bar and joins the points. Convention says that value is the close, and the convention has a defensible basis: the close is the price at which the session’s disagreement was finally settled, it is the price most widely reported, and on daily data it is the price most systems assume you could have transacted near. None of that makes it the only choice. AmiBroker will happily draw a line on the open, the high, the low or the average.
What a line chart is good at is shape. With three quarters of the numbers removed, what remains is the path of one series, and paths are what human eyes are best at. Long histories, comparisons between two instruments, and any chart where you want to see the arc of a decade rather than the texture of a week are all easier to read as lines. It is also the honest style for a series where the extra numbers do not exist or do not mean anything — a computed indicator, an equity curve, an index of your own construction.
What it hides is everything that happened inside the bar. Volatility disappears entirely: a quiet bar and a violent bar with the same close are drawn identically. Gaps between one bar’s close and the next bar’s open vanish, because the line simply connects the two closes and passes straight through territory where nothing traded. So does the relationship between the close and the day’s range, which is the single piece of intraday information a daily bar retains.
OHLC bars: four numbers in one glyph
Section titled “OHLC bars: four numbers in one glyph”A traditional bar draws a vertical line from the low to the high, with a small tick on the left for the open and on the right for the close. All four prices survive. The vertical extent is the range, so a wide-range bar looks wide-range, and a gap appears as visible empty space between one bar’s extent and the next.
The trade-off is density. Bars are drawn with thin lines, so on a compressed chart covering several years they turn into a grey wall in which individual bars are hard to separate. Bar charts reward zooming in; they punish zooming out.
Candlesticks: the same four numbers, drawn differently
Section titled “Candlesticks: the same four numbers, drawn differently”A candlestick encodes exactly the same four prices as an OHLC bar and arranges them to make one relationship jump out: where the close sits relative to the open. The filled or hollow rectangle — the body — spans open to close. The thin lines above and below it — the wicks, or shadows — reach to the high and the low.
Because the body is a filled area rather than two ticks, the eye picks up the open-to-close direction without reading anything. That is the whole design. It also means the body is what you notice first, which is a bias worth being aware of: a bar with a tiny body and enormous wicks is a bar where price travelled a long way and came back, and the candlestick draws it as a small object.
Part 7 takes candlestick anatomy apart properly and asks whether the named patterns built on it survive testing. For now the useful point is narrower: candlesticks and OHLC bars carry identical information, and the choice between them is about which relationship you want handed to you for free.
Choosing between them
Section titled “Choosing between them”There is no ranking here, only a fit between question and rendering.
| Question you are asking | Style that answers it with least effort |
|---|---|
| What is the long-run shape of this series? | Line |
| How does this instrument compare with that one? | Line, usually rebased |
| How wide was that bar, and did it gap? | OHLC bar or candlestick |
| Where did the close finish inside the session? | Candlestick |
| Is this a computed indicator or an equity curve? | Line |
| I am reading twenty years on one screen | Line, then zoom in with bars |
The habit worth building is to switch styles deliberately when the question changes, rather than picking one at the start and living inside it. Switching costs two clicks and occasionally reveals that a “clean trend” on a close-only line chart is a series of violent bars that happened to close in a tidy sequence.
Switching styles in AmiBroker
Section titled “Switching styles in AmiBroker”The price chart style lives on the View menu, under Price Chart Style. The
User’s Guide lists four choices: Auto, which uses the setting from
Tools → Preferences; Line; Candlesticks; and Bars. Changing it affects
the built-in Price chart.
Two behaviours are worth knowing before you go looking for a setting that is not there.
- The interval and the chart style are properties of a chart window, and the guide is explicit that the interval setting affects the active window only. Two windows can show the same symbol as a weekly line and a daily candlestick chart at the same time, which is exactly what you want for the multi-timeframe work in Part 14.
- The appearance of the built-in charts — candle colours and so on — is controlled
from
Tools → Preferences, not from the View menu. If your candlesticks look wrong rather than being the wrong type, that is where to look.
A formula can also read the View menu. GetPriceStyle returns the style value
currently selected there, ready to be combined into a Plot() call, which is how the
built-in Price formula manages to respond to a menu it does not own. The official
example combines it with the Parameters dialog rather than overriding it:
Fragment — not a complete formula
Plot( C, "Close", ParamColor( "Color", colorBlack ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );The | is a binary OR: style* constants are bit flags, and combining them asks for
all of the requested behaviours at once. styleCandle is 64, styleBar is 128,
styleLine is 1, and styleThick is 4, so styleLine | styleThick is a thick line.
Not every combination is meaningful — the official documentation gives
styleCandle | styleLine as an example that simply resolves to a candlestick.
A formula that makes the difference measurable
Section titled “A formula that makes the difference measurable”Looking at two chart styles and forming an impression is not evidence of anything. This formula puts the styles under your control and prints, for whichever bar you select, the numbers that separate them: the four prices, the range, the body, and the body as a percentage of the range. When that percentage is small, you are looking at a bar whose candlestick understates how far price actually travelled.
Complete formula
Section titled “Complete formula”Complete runnable AFL
// price-style-explorer.afl// Part 4 - Chart Types and What Each One Shows//// Draws one price series in whichever price style you pick in the Parameters// dialog, and reports in the title the numbers that each style keeps or throws// away. The point is not the picture. The point is that changing the style// changes what you can see, and changes nothing about what happened.//// Assumptions:// - Any instrument and any interval that has Open, High, Low and Close.// - Nothing here is a signal. Every number drawn is already inside the bar.
_SECTION_BEGIN("Price style explorer");
// maskPrice restricts the drop-down to the styles that make sense on a price// pane: thick, hidden, own scale, candlestick and bar.PriceStyle = ParamStyle( "Price style", styleCandle, maskPrice );
// A line chart draws exactly one number per bar. Which number is a convention,// not a law. ParamField's default of 3 is Close; 0, 1 and 2 are Open, High and// Low, so you can see how much the choice moves the line.LineField = ParamField( "Line-chart field", 3 );
ShowLine = ParamToggle( "Overlay the single-number line", "No|Yes", 1 );
Plot( Close, "Price", colorDefault, PriceStyle );
if ( ShowLine ){ // The same bars reduced to one number each. This is all a line chart keeps. Plot( LineField, "Line field", colorBlueGrey, styleLine | styleThick );}
// Range and body are the two quantities a candlestick encodes and a line chart// discards. Printing them makes the loss measurable instead of a matter of taste.BarRange = High - Low;BodySize = abs( Close - Open );
// A bar can have High == Low (one price traded, or a single stale print), so the// denominator is floored rather than left to produce a division by zero.SafeRange = Max( BarRange, 0.000001 );
_N( Title = Name() + " - " + Interval( 2 ) + " - what this style shows\n" + StrFormat( "O %g H %g L %g C %g\n", Open, High, Low, Close ) + StrFormat( "Range %g Body %g Body is %.1f%% of the range", BarRange, BodySize, 100 * BodySize / SafeRange ) );
_SECTION_END();How it works
Section titled “How it works”The formula has three parts. The first reads three settings from the Parameters dialog: the price style, the field a line chart should use, and whether to overlay that line at all. The second draws the price twice — once in the chosen style, once as the single-number line — so the two are on the same axis and the same scale. The third builds a title string reporting the arithmetic.
The division at the end is floored with Max( BarRange, 0.000001 ) rather than left
alone. A bar where high equals low is unusual but entirely possible — a halted
instrument, a single print, a thin listing — and dividing by its range would produce
a meaningless value that AmiBroker would then display with a straight face.
Key functions
Section titled “Key functions”ParamStyle( "name", defaultstyle, mask )adds a style drop-down to the Parameters dialog and returns the chosen combination. ThemaskPricemask limits the list to thick, hidden, own scale, candlestick and bar, which is what a price pane needs.ParamField( "name", field )returns a price array chosen from a drop-down. The documented field numbers are 0 for Open, 1 for High, 2 for Low, 3 for Close (the default), 4 for the average of high, low and close, 5 for Volume and 6 for open interest.ParamToggle( "name", "No|Yes", default )is a two-state parameter. The two labels are separated by a vertical bar, and the first one is the false value.StrFormat( formatstring, ... )builds a formatted string. Use%gor%ffor numbers — the documentation is explicit that%dwill not work, because AFL has no integer type — and%%for a literal percent sign. When you pass an array, the value used is the one at the selected bar.
Expected result
Section titled “Expected result”Test it
Section titled “Test it”Select a single bar with the Select tool and read the title. Add the range to the low and check that you get the high. Then find a bar where the body percentage is under 20% and switch to Line style: the entire range of that bar becomes invisible, and the line moves by roughly the body. That is the discard, quantified, on a bar you chose.
Common errors
Section titled “Common errors”- The title is blank or shows odd characters. A stray single
%in the format string.StrFormatneeds%%for a literal percent sign, and since version 6.10 AmiBroker reports a mismatch between specifiers and arguments as an error rather than silently guessing. - The overlay line does not move when you change the field. The Parameters dialog is per pane. If you have two price panes, you changed the other one.
- Nothing appears at all. Check that the formula was applied to a chart pane
rather than run in an Analysis window. A
Plot()in an Analysis window has nothing to draw on.
Extension
Section titled “Extension”Add a second ParamField and plot a second line, so you can see the open-to-close
line and the high-to-low line at once. Then ask yourself which of the two you have
been unconsciously reading as “the price” all this time.
What changed
Section titled “What changed”You started with three chart types that looked like three tastes. You now have a count: a line chart keeps one number of the four, an OHLC bar keeps all four, and a candlestick keeps all four and rearranges them so that one comparison is free. You also have a way of measuring, on any bar you like, exactly how much a line chart is not telling you.
The next lesson keeps the data fixed again and changes only the vertical axis — and gets a second, larger distortion for free.
Check your understanding
Sources for this lesson
8 verified · checked 2026-08-31
- 01AmiBroker User's Guide — Beginners' charting guideamibroker.com/guide/h_charting.html2026-08-31
- 02AmiBroker User's Guide — View menu§ Price Chart Styleamibroker.com/guide/m_view.html2026-08-31
- 03AFL Function Reference — Plotamibroker.com/guide/afl/plot.html2026-08-31
- 04AFL Function Reference — ParamStyleamibroker.com/guide/afl/paramstyle.html2026-08-31
- 05AFL Function Reference — ParamFieldamibroker.com/guide/afl/paramfield.html2026-08-31
- 06AFL Function Reference — GetPriceStyleamibroker.com/guide/afl/getpricestyle.html2026-08-31
- 07AmiBroker User's Guide — Using colors, styles, titles and parameters in indicators§ Style constantsamibroker.com/guide/h_indbuilder2.html2026-08-31
- 08AFL Function Reference — StrFormatamibroker.com/guide/afl/strformat.html2026-08-31
Every technical claim on this page was checked against the official AmiBroker documentation on the date shown. Where the course disagrees with folklore, the source is how you can tell which one to trust.