Skip to content
Wildflower
Join free
Indicators

Free Trading School · Level 2 · Course 2.4

The line of best fit

Lesson 56 of 99 in IndicatorsModule 7: More momentum and volume indicators

Reading the market · Indicators

The line of best fit

Wildflower Trading School · Lesson 2.4.7.24

Wildflower

In the shaped weights lesson, the least squares average read the end of a straight line drawn through the last few closes. This lesson is about that line itself, and six indicators built from it. The slope, the intercept and the angle. R-squared. The time series forecast. And the standard error. By the end, you'll know what each one measures, what units it's in, and why the angle reads the same on every market.

1 of 8

What you'll learn

  • Work out the line of best fit. Find its slope, start and end from a few closes.
  • Turn the slope into ticks a candle. Read the angle the same way on every market.
  • Read the forecast as arithmetic. It carries the line on and knows nothing new.
  • Score how straight the closes are. R-squared says how straight, not which way.
  • Measure how far closes stray. Work out the standard error in ticks.

Exercise

  1. On the 5-minute practice chart in Wildflower, or any platform, take the closes of the last 5 .
  2. Work out the as in the worked example, and turn it into a candle for your market.

Practise this on Wildflower's free practice chart. It needs a free account.

Join waitlist

Quick check

  1. 1. A line of best fit rises 1 tick a candle. What is its angle?

  2. 2. R-squared is 0.95. What does that tell you?

  3. 3. What is the time series forecast?

0 of 3 answered.

Finished this lesson?

Tick it off and keep your place

Make a free account and we'll remember where you are, so “Bands around the line” is waiting next time.

Read the full notes

The line of best fit is the straight line through the last closes with the smallest misses. Its slope is in ticks a candle, its angle in degrees (45 is one tick a candle on every market), R-squared says how straight the closes are, the forecast carries the line one candle on, and the standard error says how far closes stray.

  • The is the straight line through the last closes with the smallest misses, squared and added (least squares). It passes through the average close at the middle candle. Its end is the (Averages with shaped weights).
  • Closes 5,000, 5,002, 5,005, 5,004, 5,009: average 5,004; (8 + 2 + 0 + 0 + 10) ÷ 10 = 2 points a candle; line 5,000 to 5,008; 5,000 (the oldest candle); end 5,008.
  • The is the line carried one candle on: 5,008 + 2 = 5,010. It's arithmetic, not a prediction. On a steady climb, the close sits below it the whole way (Position and swing oscillators has the ).
  • In Wildflower the slope is in a candle: 2 points on the (tick 0.25) is 8 ticks.
  • The turns ticks a candle into degrees: 1 tick = 45° on every market, 2 = 63°, 4 = 76°, 8 = 83°, never 90. It isn't scaled by the range, as the is, and it isn't the angle on your screen.
  • = squared, 0 to 1. 0.9 gives 0.81. It says how straight, not which way. The five closes: 1 − 6 ÷ 46 = 0.87 (Is the market trending or choppy?).
  • The = √(misses squared and added ÷ (closes − 2)): √(6 ÷ 3) = 1.41 points, 5.66 ticks. It divides by 2 fewer because the line was fitted to the same closes.
  • On the made-up chart, the 20-candle R-squared was 0.94 at the top of the climb (8.1 ticks a candle), 0.15 sideways (at most 0.18 once all 20 closes were sideways) and 0.96 in the fall (−6.1 ticks a candle).

Worked example

Made-up numbers

The line through five closes

Made-up numbers · Micro S&P 500 · closes 5,000, 5,002, 5,005, 5,004, 5,009

  1. Average close 5,004, at the middle candle (number 2 of 0 to 4)
  2. Candle distances −2, −1, 0, 1, 2; close distances −4, −2, 1, 0, 5
  3. Multiply and add: 8 + 2 + 0 + 0 + 10 = 20. Divide by 4 + 1 + 0 + 1 + 4 = 10. Slope 2 points, or 8 ticks, a candle
  4. Line 5,000, 5,002, 5,004, 5,006, 5,008. Forecast 5,010
  5. Misses 0, 0, 1, −2, 1. Squared and added, 6. Standard error √(6 ÷ 3) = 1.41. R-squared 1 − 6 ÷ 46 = 0.87

The line rises 2 points a candle, fits the closes well but not exactly, and its next step is 5,010. That step is arithmetic, not a prediction.

Your turn

Drill

Made-up numbers · Micro S&P 500 · tick 0.25 · slope 1.5 points a candle

Trading is risky. You can lose money. This lesson explains how trading works. It isn't advice.