Skip to content
Level 1 · Chart ReaderLessonPart 04 · page 1 of 522 min
22Minutes
6AFL functions
8Sources
StandardRequires
AFL functions taught here6

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.

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

Illustrative numbers, not market data. Bar 5 moved 3.6 points from low to high and finished 0.2 above its open; a close-only line chart records the 0.2.
Bar12345
Open100.0101.5103.0102.0102.2
High102.0104.0103.4103.8102.6
Low99.5101.0100.2101.699.0
Close101.5103.0100.6102.2102.4
Range (High - Low)2.53.03.22.23.6
Line chart draws101.5103.0100.6102.2102.4
Illustrative numbers, not market data. Bar 5 moved 3.6 points from low to high and finished 0.2 above its open; a close-only line chart records the 0.2. Prices in this diagram are invented for the illustration. They are not market data and nothing should be inferred from them.

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
BarOpenHighLowClose
1100102100102
2102104101103
3103103100101
4102104102102
510210399102
Four of every five numbers are gone. Bar 5's 3.6-point range is drawn as a 0.2 rise. The data in this chart is invented for the illustration. It is not market data and nothing should be inferred from it.

Rendering 2 - OHLC bars, four numbers in one glyph

  • Close above open
  • Close below open
Show the numbers behind this chart
BarOpenHighLowClose
1100102100102
2102104101103
3103103100101
4102104102102
510210399102
The vertical extent is the range, so bar 5 is now obviously the widest-range bar of the five - the fact the line chart threw away. The data in this chart is invented for the illustration. It is not market data and nothing should be inferred from it.

Rendering 3 - candlesticks, the same four numbers

  • Close above open
  • Close below open
Show the numbers behind this chart
BarOpenHighLowClose
1100102100102
2102104101103
3103103100101
4102104102102
510210399102
Identical information to the bar chart, weighted differently: the body makes the open-to-close move the loudest thing on the chart, and the wick makes bar 5's excursion to 99.0 unmissable. The data in this chart is invented for the illustration. It is not market data and nothing should be inferred from it.

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.

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.

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.

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 runnable AFL

price-style-explorer.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();

Download price-style-explorer.afl49 lines

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.

  • ParamStyle( "name", defaultstyle, mask ) adds a style drop-down to the Parameters dialog and returns the chosen combination. The maskPrice mask 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 %g or %f for numbers — the documentation is explicit that %d will 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.

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.

  • The title is blank or shows odd characters. A stray single % in the format string. StrFormat needs %% 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.

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.

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

Question 1. A bar has Open 102.0, High 103.8, Low 101.6, Close 102.2. A close-only line chart draws it as one point. How many of the four prices does that point encode?
Show the answer and why

Answer: One: the close

A line chart plots a single chosen value per bar. The other three prices are not drawn, not compressed — they are absent from the picture entirely, which is why range and gaps are invisible on a line chart.

Question 2. Which of these statements about candlesticks and OHLC bars is correct?
Show the answer and why

Answer: They encode the same four prices and differ only in how those prices are drawn

Both styles draw open, high, low and close. The candlestick renders open-to-close as a filled body so that one comparison is readable without effort, which is a presentation choice, not extra data.

Question 3. You want to compare the ten-year shape of two instruments on one screen. Which style is the natural first choice, and why?
Show the answer and why

Answer: Line, because at that compression individual bars cannot be resolved anyway

Keeping data you cannot see is not an advantage. At ten years on one screen, bar and candle glyphs overlap into a solid block, and the question being asked is about shape, which is precisely what a line renders best.

Question 4. In `Plot( C, "Close", colorBlack, styleLine | styleThick )`, what does the vertical bar do?
Plot( C, "Close", colorBlack, styleLine | styleThick );
Show the answer and why

Answer: Combines the style flags so both apply

The style* constants are bit flags with documented numeric values (styleLine is 1, styleThick is 4). The binary OR combines them, so the plot is a line and it is thick. Not every combination is meaningful — styleCandle | styleLine simply resolves to a candlestick.

Question 5. True or false: changing the chart interval in one AmiBroker chart window changes it in every open window.
Show the answer and why

Answer: False

False. The User's Guide states that the interval setting affects the active window only, which is what makes a multi-timeframe layout possible. Windows can be linked deliberately using the small "S" and "I" buttons beside the scroll bar.

Sources for this lesson

8 verified · checked 2026-08-31

  1. 01AmiBroker User's Guide — Beginners' charting guideamibroker.com/guide/h_charting.html2026-08-31
  2. 02AmiBroker User's Guide — View menu§ Price Chart Styleamibroker.com/guide/m_view.html2026-08-31
  3. 03AFL Function Reference — Plotamibroker.com/guide/afl/plot.html2026-08-31
  4. 04AFL Function Reference — ParamStyleamibroker.com/guide/afl/paramstyle.html2026-08-31
  5. 05AFL Function Reference — ParamFieldamibroker.com/guide/afl/paramfield.html2026-08-31
  6. 06AFL Function Reference — GetPriceStyleamibroker.com/guide/afl/getpricestyle.html2026-08-31
  7. 07AmiBroker User's Guide — Using colors, styles, titles and parameters in indicators§ Style constantsamibroker.com/guide/h_indbuilder2.html2026-08-31
  8. 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.