Before any indicator, there is the candle
RSI, MACD, Bollinger Bands, moving averages: technical analysis has a long list of indicators with impressive names. Every one of them is calculated from the same four prices per day, the open, high, low and close. If you can turn those four numbers into a daily return, a candle body and two wicks in Excel, you already understand the raw material of the whole field, and you can check any indicator yourself instead of trusting a charting app.
This free first lesson is for spreadsheet users who want to understand price charts, finance students meeting technical analysis for the first time, data analysts who need to prepare OHLC data, and anyone who has looked at a candlestick chart and wondered what exactly is being drawn. You will work with twelve trading days of a fictional share, Corvane Robotics (CRVN), from 31 August to 15 September 2026.
OHLC data and the candlestick, explained simply
For each trading day, an exchange records four prices. The open is the first traded price of the session, the close the last one. The high and low are the extremes reached in between. Together they are called OHLC data, and they are what you get when you download daily prices from almost any data provider.
A candlestick draws one day as a single shape. The thick body spans the open and the close. Thin lines, the wicks or shadows, extend from the body up to the high and down to the low. If the close is above the open, the price rose during the session and the candle is bullish, usually drawn green or hollow. If the close is below the open, it is bearish, usually red or filled. The colours only describe the direction within that one day.
In numbers: body = ABS(close − open). The upper wick runs from the top of the body to the high. The top of the body is the open on a bearish day and the close on a bullish day, so in Excel it is MAX(open, close) and the upper wick is high − MAX(open, close). The lower wick mirrors it: MIN(open, close) − low. Using MAX and MIN means one formula works for both candle types.
The daily return links each day to the one before: close / previous close − 1. It measures the change from one session's close to the next, including any gap overnight. That is different from the move inside one day (close versus open), which the candle body shows. Returns, not prices, are what most indicators and every backtest work with, because a 1 % move means the same thing whether a share costs $5 or $500.
Worked example: twelve days of Corvane Robotics
Here is the full lab with every derived column calculated. Columns B to E are the given prices, column H (upper wick) is pre-filled as a worked example, and you calculate the return, body, lower wick and label. The first day has no return because there is no previous close in the sheet.
| Date | Open | High | Low | Close | Return | Body | Upper wick | Lower wick | Candle |
|---|---|---|---|---|---|---|---|---|---|
| 31 Aug | 47.55 | 48.17 | 47.44 | 47.80 | – | 0.25 | 0.37 | 0.11 | Bullish |
| 1 Sep | 47.88 | 48.75 | 46.93 | 46.96 | -1.76 % | 0.92 | 0.87 | 0.03 | Bearish |
| 2 Sep | 47.04 | 47.67 | 46.40 | 47.30 | +0.72 % | 0.26 | 0.37 | 0.64 | Bullish |
| 3 Sep | 47.39 | 48.92 | 47.13 | 48.12 | +1.73 % | 0.73 | 0.80 | 0.26 | Bullish |
| 4 Sep | 48.44 | 48.66 | 47.19 | 47.92 | -0.42 % | 0.52 | 0.22 | 0.73 | Bearish |
| 7 Sep | 48.05 | 48.20 | 47.55 | 47.76 | -0.33 % | 0.29 | 0.15 | 0.21 | Bearish |
| 8 Sep | 47.74 | 47.80 | 46.15 | 46.69 | -2.24 % | 1.05 | 0.06 | 0.54 | Bearish |
| 9 Sep | 47.00 | 47.16 | 46.14 | 46.17 | -1.11 % | 0.83 | 0.16 | 0.03 | Bearish |
| 10 Sep | 46.12 | 46.20 | 45.94 | 46.03 | -0.30 % | 0.09 | 0.08 | 0.09 | Bearish |
| 11 Sep | 46.07 | 46.30 | 45.34 | 46.00 | -0.07 % | 0.07 | 0.23 | 0.66 | Bearish |
| 14 Sep | 46.00 | 46.30 | 45.78 | 46.15 | +0.33 % | 0.15 | 0.15 | 0.22 | Bullish |
| 15 Sep | 46.39 | 47.25 | 45.96 | 46.91 | +1.65 % | 0.52 | 0.34 | 0.43 | Bullish |
The formulas in row 5 are F5: =E5/E4-1, G5: =ABS(E5-B5), H5: =C5-MAX(B5,E5), I5: =MIN(B5,E5)-D5 and J5: =IF(E5>B5,"Bullish","Bearish"). All use relative references, so you enter them once and fill down. The return column starts in row 5. The other columns start in row 4.
Reading the numbers rather than the picture gives you precision. On 1 September the share opened at 47.88, briefly reached 48.75, then sold off to close at 46.96: a bearish body of 0.92 with a long upper wick of 0.87 and almost no lower wick (0.03), because the close sat just above the low. On 3 September the opposite happened: a bullish body of 0.73 and the highest return of the period, +1.73 %. On 10 September the whole range from low to high was only 0.26, the calmest day of the sample.
Over the twelve days, five candles are bullish and seven bearish, and the close moved from 47.80 to 46.91. Those are descriptions of what happened in this fictional data. Technical analysts give names to certain shapes, such as long upper wicks or very small bodies, but in this course you treat them as measurable features, not as forecasts.
Summarising twelve days in a few cells
Once the derived columns exist, a handful of summary formulas describe the whole period. They are worth adding below the data because they turn twelve rows into a few facts you can quote, and because several of them reappear in later lessons. All values below are from the fictional lab data.
| Summary | Excel formula | Result |
|---|---|---|
| Bullish days | =COUNTIF(J4:J15,"Bullish") | 5 of 12 |
| Average body | =AVERAGE(G4:G15) | 0.47 |
| Average daily range (high − low) | =SUMPRODUCT(C4:C15-D4:D15)/12 | 1.12 |
| Highest high / lowest low | =MAX(C4:C15) / =MIN(D4:D15) | 48.92 / 45.34 |
| Change over the period | =E15/E4-1 | −1.86 % |
| Same, by compounding the returns | =PRODUCT(1+F5:F15)-1 | −1.86 % |
| Simple sum of the returns | =SUM(F5:F15) | −1.80 % |
| Standard deviation of returns | =STDEV.S(F5:F15) | 1.26 % |
Two lines in that table deserve a closer look. Compounding the daily returns with PRODUCT(1+F5:F15)-1 gives exactly the same answer as comparing the last close with the first, −1.86 %. Simply adding the returns gives −1.80 %, which is close but not the same, because each day's percentage applies to a different starting price. Over twelve quiet days the gap is small. Over longer periods or bigger moves it grows, and it is one of the most common errors in homemade performance sheets. In older Excel versions the PRODUCT formula must be confirmed with Ctrl+Shift+Enter because it works on an array.
The standard deviation of the daily returns, about 1.26 % here, is the usual starting point for measuring volatility. Later in the course Bollinger Bands use a standard deviation of prices in the same spirit: a wider spread means the price has been moving around more.
Gaps: what happens between two candles
The candle covers one session, the daily return covers close to close. The difference between the two is the gap, the move from yesterday's close to today's open, =B5-E4 in dollars or =B5/E4-1 in percent. On 4 September Corvane closed the day before at 48.12 and opened at 48.44, a gap of +0.32. It then fell during the session to close at 47.92, so the day shows a bearish candle even though the close-to-close return was only −0.42 %. On 9 September the open of 47.00 was 0.31 above the previous close of 46.69, yet the day closed lower again.
This is why the candle colour and the sign of the return can disagree. A bearish candle only says the close was below the open. It does not say the price fell compared with yesterday. Keeping the return and the candle in separate columns, as the lab does, avoids mixing up the two ideas, and a gap column is a natural extra you can add yourself in column K.
How to do it in Excel, step by step
- Put the headers in row 3: Date, Open, High, Low, Close, Return, Body, Upper wick, Lower wick, Candle. Enter the dates in A4:A15 and format them with Ctrl+1 › Number › Date (Excel stores 15 Sep 2026 as the serial number 46280).
- Enter the OHLC prices in B4:E15. Check the order of your data source: some exports put the close before the high and low.
- In F5 type
=E5/E4-1and press Enter. Format F5:F15 as a percentage with two decimals (Ctrl+Shift+5, then Home › Number › Increase Decimal twice). - In G4 type
=ABS(E4-B4), in H4=C4-MAX(B4,E4), in I4=MIN(B4,E4)-D4, and in J4=IF(E4>B4,"Bullish","Bearish"). - Select G4:J4 and double-click the fill handle to copy down to row 15. For the return, select F5:F15 and press Ctrl+D.
- Highlight the down days: select F5:F15, then Home › Conditional Formatting › Highlight Cells Rules › Less Than, type 0, choose Light Red Fill and click OK.
- Optional: draw the chart. Select A3:E15 and use Insert › Charts › Waterfall, Stock or Surface › Open-High-Low-Close. Excel expects the columns in exactly that order: date, open, high, low, close.
- Optional: count candle types with
=COUNTIF(J4:J15,"Bullish")and find the largest single-day fall with=MIN(F5:F15).
=AND(C4>=MAX(B4,E4),D4<=MIN(B4,E4)) must be TRUE on every row. A FALSE means a high below the close or a low above the open, which is a data error, often a swapped column.
Common mistakes and how to spot them
- Comparing the close with the same day's open for the return.
=E5/B5-1is the intraday move, not the daily return. The daily return uses yesterday's close. Spot it by checking that the first return row references the row above. - Forgetting ABS for the body. Without it, bearish days get a negative body. If you see negative numbers in a "length" column, a wrapper is missing.
- Using the close for the bottom of the body.
=E14-D14is only right on bearish days. On 14 September (bullish) it gives 0.37 instead of 0.22. MIN(open, close) avoids this. - Swapped labels. If 3 September, the biggest up day, is labelled Bearish, the IF arguments are in the wrong order.
- Starting the return in the first row. The first day has no previous close in the sheet. A formula in F4 would reference the header row and return an error.
- Highlighting "below average" instead of "below zero". Below-average rules flag returns under the period mean, which can include small up days. A down day is a return below 0.
- Unsorted dates. If the data comes newest-first, every return is calculated backwards. Sort with Data › Sort Oldest to Newest before filling formulas.
Quick reference: formulas and shortcuts used
The complete toolkit of this lesson. Every later indicator in the course is built on these columns.
| Measure | Excel formula (row 4 or 5) | Function |
|---|---|---|
| Daily return | =E5/E4-1 | arithmetic |
| Body | =ABS(E4-B4) | ABS |
| Upper wick | =C4-MAX(B4,E4) | MAX |
| Lower wick | =MIN(B4,E4)-D4 | MIN |
| Candle label | =IF(E4>B4,"Bullish","Bearish") | IF |
| Count bullish days | =COUNTIF(J4:J15,"Bullish") | COUNTIF |
| Largest fall | =MIN(F5:F15) | MIN |
| OHLC sanity check | =AND(C4>=MAX(B4,E4),D4<=MIN(B4,E4)) | AND |
| Highlight down days | Home › Conditional Formatting › Less Than 0 | menu |
| Percent format / fill down | Ctrl+Shift+5 / Ctrl+D | shortcut |
Real-world uses
- Cleaning downloaded price data. Before any analysis, the sanity check and the return column reveal missing days, swapped columns and stock-split jumps that a chart would hide.
- Describing volatility in a report. The average body or the average high-low range per day is a simple, explainable measure of how much a price moved, useful for a finance assignment or a market commentary.
- Checking a charting tool. When a platform shows a candle or a return you do not trust, rebuild the day in four cells and compare.
- Preparing data for other models. Daily returns are the input for volatility, correlation and risk measures used in portfolio courses, not only in technical analysis.
- Teaching and learning. Building candles from numbers makes a chart readable in a way that memorising pattern names does not.
What you will build in the rest of this course
This first lesson is free. The lessons below are part of the paid course ($9.90 one-time), each with its own live lab that checks your formulas cell by cell, using 30 days of fictional Corvane prices.
Simple & Exponential Moving Averages. You smooth 30 daily closes with a 5-day and a 10-day simple moving average and build a 10-day exponential moving average row by row, so you see exactly how the weighting differs.
Moving-Average Crossover Signals. You label each day by whether the short average is above the long one, detect the days where they cross and count those events with formulas.
RSI (14) with Wilder's Smoothing. You calculate the 14-day average gain and loss with Wilder's smoothing and turn them into the Relative Strength Index, the step most tutorials skip.
MACD: Line, Signal & Histogram. You build the MACD line from two EMAs, smooth it into a signal line and read the histogram, with periods scaled down to fit 30 days.
Bollinger Bands & %B. You draw 20-day bands around the SMA20 and measure where the close sits inside them with %B.
Support, Resistance & Breakout Flags. You turn the last 10 days' highs and lows into rolling levels and flag the days the close moved outside them.
Backtest a Simple Rule vs Buy-and-Hold. You test the crossover rule on the fictional data without look-ahead bias and compare total return, win rate and maximum drawdown with simply holding, learning how backtests are built and why their results describe the past only.
Summary
Every technical indicator starts from four prices a day. The body is the distance between open and close, the wicks reach to the high and low, and MAX and MIN let one formula handle bullish and bearish days alike. The daily return compares each close with the previous one and is the building block for everything that follows. Scroll up to the lab, fill in columns F, G, I and J for Corvane Robotics, highlight the down days, and let the sheet check each formula.
Frequently asked questions
How do you calculate the body of a candlestick in Excel?
Use the absolute difference between close and open, for example =ABS(E4-B4). ABS keeps the body positive on bearish days, when the close is below the open.
What is the formula for the upper and lower wick?
Upper wick = high − MAX(open, close) and lower wick = MIN(open, close) − low. MAX and MIN pick the top and bottom of the body for both bullish and bearish candles.
How do I calculate daily returns in Excel?
Divide today's close by yesterday's close and subtract 1, for example =E5/E4-1, then fill down. The first day has no return because there is no previous close.
What is the difference between a bullish and a bearish candle?
A bullish candle closes above its open and a bearish candle closes below its open. The label only describes the price direction within that one day.
Can Excel draw a candlestick chart?
Yes. Arrange the columns as date, open, high, low, close, select them and use Insert, Charts, Stock, Open-High-Low-Close.
Do technical indicators predict future prices?
No. They summarise what prices did in the past. This course teaches how they are calculated in Excel for educational purposes, not how to make trading decisions.
Keep going: Technical Analysis Indicators in Excel
This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time $9.90.
- Simple & Exponential Moving Averages
- Moving-Average Crossover Signals
- RSI (14) with Wilder's Smoothing
- MACD: Line, Signal & Histogram
- Bollinger Bands & %B
- Support, Resistance & Breakout Flags
- Backtest a Simple Rule vs Buy-and-Hold
- Momentum & Rate of Change (ROC) with a Signal Line
- Heikin-Ashi Candles: Smoothed Bars & Trend Runs
- Commodity Channel Index (CCI): Typical Price & Mean Deviation
- Bollinger Bandwidth & the Squeeze
- Opening Gaps: Size, Direction & Same-Day Fills
- Weekly Bars from Daily Data: a Multi-Timeframe View
- Relative Strength vs a Sector Index: Rebasing & the RS Line
- Market Breadth: Net Advances, the A/D Line & Divergences
- A Percent Trailing Stop: Stop Level, Exit Day & Trade Result
- Do Signals Work? Forward Returns After a Buy Signal
- Overfitting Check: In-Sample vs Out-of-Sample Results
- Final Project: A Technical Dashboard for Ten Stocks