Pivot Point Strategy

16 min read

In this project, we analyze different intraday trading strategies with Pivot Points. After defining different ways of calculating the Pivot Point, we do a Backtest with the most classic strategies and a different variant to those normally taught in textbooks.

To learn about Pivot Point and how to use it to predict movement in trade markets, read this blog.

This article is the final project submitted by the authors as a part of their coursework in the Executive Programme in Algorithmic Trading (EPAT®) at QuantInsti®. Do check our Projects page and have a look at what our students are building.

About the Author

A Multi-asset Portfolio Manager at Morabanc Asset Management, Tomás García-Purriños has over 10 years of experience in the financial sector. Among his strengths are economic analysis, asset allocation and alternative strategies with a global macro approach. Tomás is a Chartered Financial Analyst (CFA), Chartered Alternative Investment Analyst (CAIA) and holds a Master´s degree in Financial Markets from the IEB. He also teaches in several universities and business schools.

Introduction

Born probably in Chicago, Pivot Point is a popular technique among traders to calculate supports and resistances. It appears in most of the textbooks and curriculums dedicated to the study of technical analysis (i.e. CMT or CFTe), and is on the list of most common indicators in technical analysis software.

However, as with most technical indicators, public academic studies are scarce and the majority of backtests are either private (i.e proprietary research) or in blogs, etc.

There are different methods of calculating Pivot Point levels. We have tested strategies calculating the central pivot point in two different ways:

  • As the average between close, maximum and minimum of the previous day;
  • Including the opening of the current day;
  • Adding the opening twice and without closing price (Woodie's method).

The close price has been taken at 15:59. The remaining levels have been calculated as follows:

Classic / Woodie

Camarilla

Fibonacci

Support 1 (S1)

2 * Pivot Point - H

Pivot Point - (0.0916 * Range)

Pivot Point - (0.382 * Range)

Resistance 1

(R1)

2 * Pivot Point - L

Pivot Point + (0.0916 * Range)

Pivot Point + (0.382 * Range)

Support 2 (S2)

Pivot Point - H - L

Pivot Point - (0.183 * Range)

Pivot Point - (0.618 * Range)

Resistance 2 (R2)

Pivot Point+ H - L

Pivot Point + (0.183 * Range)

Pivot Point + (0.618 * Range)

Support 3 (S3)

S1 - H - L

Pivot Point - (0.275 * Range)

Pivot Point - (1 * Range)

Resistance 3 (R3)

R1+ H - L

Pivot Point + (0.275 * Range)

Pivot Point + (1 * Range)

H = Last Period High
L = Last Period Low
Range = Last Period High - Last Period Low

Figure 1: Pivot Point Levels

In this EPAT Final Project, we analyze different Pivot Point strategies on futures listed in CME (Mini S&P 500, Treasury, EURUSD and Gold).

Methodology

For Backtesting the strategies, we have used Python with Pandas, Numpy, Matplot and QuantStats libraries.

It is important to take into account different aspects of the analysis that could have taken their toll on the results:

  • The study was conducted with intraday data of one minute. There may be differences between the closing price of each minute and the price at which strategy would actually have been executed (slippage) and nothing ensures that there was enough volume. Also, commissions, fees and taxes have not been taken into account. Despite the above, the products chosen have remarkable liquidity and low commissions cost, so we estimate a low impact (subtracting around -0,25%/-0,75% to the cumulate returns of the sample backtest).
  • We´ve used the first contract of the future, so rollover hasn´t been taken into account. In the study sample, there has been at least one roll, which will impact on the calculation of the Pivot Points of the next day and therefore on the results of the day.
  • Due to difficulties in calculations, it has been preferred not to trade on Sundays (and eliminate this day for the Monday´s Pivot Points, which are calculated with Friday´s levels).

Backtest

A 250-day sample and a 30-day Out Of Sample analysis have been used to analyze the results.

Initially, the idea was to test the most classic strategies, as explained in the textbooks (i.e. buy in supports and sell resistances, or buy when Price open above the pivot point, sell when Price open below Pivot Point, etc). However, the poor results obtained made us think they don´t work anymore.

We analyzed two alternative strategies:

Strategy 1: Buy when price breaks resistance. Add +1 contract in the breakdown of each resistance. Sell ​​when price breaks support. Add -1 contract in each break. The position must be between -3 and +3 contracts. Close all positions at the end of the day. This strategy does the opposite of what the textbook says.

Strategy 2: A slightly more elaborated version of Strategy 1. If the price opens above the Pivot Point, and if crosses below the Pivot Point, sell -2 contracts and add -1 on support 1 with a target on supports 2 and 3 (+2 on support 1 and +1 on support 2) and stop at the resistances. If the price opens below the Pivot Point, buy +2 when the price crosses up the centre pivot and add in resistance 1 +1, with targets in resistance 2 and 3 (-2 in resistance 2 and -1 in resistance 3) and stop on supports. Close all positions at the end of the day.

BT Strategy 1

In general, the results are mediocre, although somewhat better than the textbook version. The difference between methods of calculating pivot points is minimal, given that levels are relatively similar. In any case, the one that seems to give the best results, or at least the most stable, is the Classic method including the opening.

The only remarkable results using this strategy are on EURUSD, but they are not supported outside the sample and seem more a coincidence than a cause of the strategy.

You can find a summary of the results in Appendix 1.

BT Strategy 2

More interesting has been the results of the second strategy.

The results obtained with the MiniSP stand out especially. 

The strategy shows consistent performance throughout the analyzed period and strongly trends in August:

Graph 1: Strategy 2. Cumulative Returns vs Benchmark MiniSP

Although drawdowns are higher than a Buy & Hold strategy, potential returns are higher too and compensate that risk as to the high Calmar Ratio shows.

This consistency remains out of the sample:

Graph 2: Strategy 2. Cumulative Returns vs Benchmark MiniSP Out Of Sample

In the case of Gold, we found positive results, although less colourful:

Graph 3: Strategy 2. Cumulative Returns vs Benchmark Gold

They don't stay out of the sample. Perhaps because of the strong trend that started in August:

Graph 4: Strategy 2. Cumulative Returns vs Benchmark Gold Out of Sample

Similarly, EURUSD repeats this pattern, but of less magnitude, while the Treasury shows good results, although out of the sample it behaves similarly to Gold at the end of the backtested period: it seems this system behaves worse in very trendy markets.

Graph 5: Strategy 2. Cumulative Returns vs Benchmark EURUSD

Graph 6: Strategy 2. Cumulative Returns vs Benchmark EURUSD Out of Sample

Graph 7: Strategy 2. Cumulative Returns vs Benchmark Treasury Futures

Graph 8: Strategy 2. Cumulative Returns vs Benchmark Treasury Futures Out of Sample

A summary of the main statistics is attached in Appendix 2.

Conclusion

We can highlight these main conclusions:

  • Pivot Points calculation differences do not offer significant changes in the results of simple systems.
  • Traditional trading strategies, as taught in the textbook, do not seem to work anymore. Also, the simplest or most obvious strategies do not work either way (neither for purchases nor to do the opposite). But small modifications in traditional strategies do seem to work and give some hope to continue researching.
  • It seems that mean regression strategies work worse than momentum. All in all, in very trendy markets, no one beats a simple Buy & Hold.
  • It would be interesting to continue researching and trying to find indicators to add to the strategy, especially those that made it rotate from momentum to average regression depending on the type of market.

Bibliography

Books:

  • Candlestick and Pivot Point Trading, John L. Person, Wiley 2007.
  • Computer Analysis of the Futures Market, Charles LeBeau y David W. Lucas, 1992.

Magazines:

Workpapers:

Wilinski, Antoni & Nyczaj, Tomasz & Bera, Aneta & Błaszyński, Piotr. (2013). A study on the effectiveness of investment strategy based on the concept of pivot points levels using Matthews criterion. Journal of Theoretical and Applied Computer Science. 7. 42-55.

Webs:

StockCharts, ChartSchool » Technical Indicators and Overlays » Pivot Points: https://school.stockcharts.com/doku.php?id=technical_indicators:pivot_points

X-Trader.net » Especial Pivot Points: https://www.x-trader.net/foro/viewtopic.php?t=20210

APPENDIX 1: STRATEGY 1 BACKTEST

Table 1: Summary of Strategy 1 Backtest

Treasury Futures

Gold

Mini SP

EURUSD

EURUSD Out of Sample

Strategy 1

Buy & Hold

Strategy 1

Buy & Hold

Strategy 1

Buy & Hold

Strategy 1

Buy & Hold

Strategy 1

Buy & Hold

Start Period

05/02/2019

05/02/2019

05/02/2019

05/02/2019

05/02/2019

05/02/2019

05/02/2019

05/02/2019

21/08/2019

21/08/2019

End Period

21/08/2019

21/08/2019

21/08/2019

21/08/2019

21/08/2019

21/08/2019

21/08/2019

21/08/2019

20/09/2019

20/09/2019

Time in Market

58.0%

100%

52.0%

100%

55.0%

100%

71.0%

100%

52.0%

100%

Number of Trades

170

171

166

189

28

Cumulative Return

0.61%

7.09%

5.5%

14.25%

10.12%

7.02%

-7.28%

-2.77%

-2.02%

-0.25%

CAGR%

1.14%

13.54%

10.43%

27.99%

19.56%

13.4%

-13.08%

-5.07%

-22.03%

-3.02%

Sharpe

0.23

2.51

0.58

1.58

1.17

0.84

-1.1

-0.81

-2.57

-0.44

Sortino

0.4

4.61

1.18

2.86

2.05

1.14

-1.86

-1.13

-2.74

-0.65

Max Drawdown

-2.42%

-1.59%

-8.06%

-5.54%

-7.08%

-6.98%

-12.26%

-3.63%

-3.16%

-1.87%

Longest DD Days

114

56

111

113

105

61

190

153

15

25

Volatility (ann.)

3.74%

3.5%

13.24%

11.13%

10.99%

10.93%

8.44%

4.32%

6.38%

4.45%

Calmar

0.47

8.54

1.29

5.05

2.76

1.92

-1.07

-1.4

-6.97

-1.61

Skew

2.24

0.92

3.12

1.67

1.78

-1.06

1.67

0.21

-2.95

0.37

Kurtosis

13.68

3.16

18.76

9.05

11.25

5.11

4.16

2.82

11.07

0.14

Expected Daily %

0.0%

0.03%

0.03%

0.07%

0.05%

0.03%

-0.04%

-0.01%

-0.07%

-0.01%

Expected Monthly %

0.09%

0.98%

0.77%

1.92%

1.39%

0.97%

-1.07%

-0.4%

-1.02%

-0.13%

Expected Yearly %

0.61%

7.09%

5.5%

14.25%

10.12%

7.02%

-7.28%

-2.77%

-2.02%

-0.25%

Daily Value-at-Risk

-0.38%

-0.33%

-1.34%

-1.08%

-1.09%

-1.1%

-0.91%

-0.46%

-0.73%

-0.47%

Expected Shortfall (cVaR)

-0.55%

-0.55%

-1.83%

-1.83%

-1.63%

-1.63%

-1.06%

-1.06%

-1.31%

-1.31%

Payoff Ratio

1.48

2.51

2.71

3.24

0.9

2.34

1.78

2.23

0.73

2.53

Profit Factor

0.06

0.65

0.19

0.4

0.36

0.18

0.19

0.15

0.53

0.07

Common Sense Ratio

0.06

0.88

0.3

0.51

0.32

0.17

0.31

0.14

0.24

0.08

CPC Index

0.04

0.91

0.18

0.66

0.17

0.25

0.11

0.15

0.22

0.09

Tail Ratio

1.0

1.34

1.6

1.29

0.89

0.93

1.62

0.95

0.46

1.09

Outlier Win Ratio

9.52

6.37

9.94

7.73

8.84

6.76

4.35

10.15

6.85

3.27

Outlier Loss Ratio

3.03

2.88

3.21

3.07

3.64

3.12

1.89

3.38

1.82

3.71

MTD

0.44%

2.43%

-3.03%

6.37%

2.66%

-1.98%

-3.92%

0.3%

-2.8%

0.74%

3M

0.49%

5.01%

8.26%

17.57%

12.26%

2.31%

1.21%

-0.54%

-2.02%

-0.25%

6M

0.09%

6.94%

8.08%

13.22%

5.21%

5.32%

-6.9%

-1.76%

-2.02%

-0.25%

YTD

0.61%

7.09%

5.5%

14.25%

10.12%

7.02%

-7.28%

-2.77%

-2.02%

-0.25%

1Y

0.61%

7.09%

5.5%

14.25%

10.12%

7.02%

-7.28%

-2.77%

-2.02%

-0.25%

Best Day

1.48%

1.05%

5.5%

4.56%

4.24%

2.19%

2.5%

0.94%

0.45%

0.65%

Worst Day

-0.77%

-0.57%

-2.53%

-1.69%

-2.1%

-3.51%

-1.18%

-0.94%

-1.78%

-0.5%

Best Month

0.94%

2.43%

8.41%

8.15%

3.38%

7.31%

4.64%

2.28%

0.8%

0.74%

Worst Month

-0.79%

-0.47%

-3.03%

-1.68%

-1.94%

-6.94%

-6.81%

-3.03%

-2.8%

-0.99%

Avg. Drawdown

-0.47%

-0.39%

-1.94%

-1.48%

-1.69%

-1.44%

-6.2%

-2.8%

-1.75%

-1.0%

Avg. Drawdown Days

19

9

20

15

17

8

96

98

8

13

Recovery Factor

0.25

4.47

0.68

2.57

1.43

1.01

-0.59

-0.76

-0.64

-0.13

APPENDIX 2: SUMMARY OF STRATEGY 2 BACKTEST

Table 2: Summary of Strategy 2 Mini S&P Backtest

Mini S&P 500

Mini S&P 500 Out of Sample

Start Period

05/02/2019

05/02/2019

21/08/2019

21/08/2019

End Period

21/08/2019

21/08/2019

20/09/2019

20/09/2019

Time in Market

67.0%

100%

65.0%

100%

Number of Trades

211

34

Cumulative Return

45.03%

6.51%

5.12%

3.74%

CAGR%

99.15%

12.39%

83.65%

56.27%

Sharpe

2.62

0.79

2.76

2.57

Sortino

5.26

1.06

5.98

3.69

Max Drawdown

-6.31%

-7.11%

-2.98%

-2.78%

Longest DD Days

90

61

10

12

Volatility (ann.)

18.77%

10.95%

15.14%

11.87%

Calmar

15.72

1.74

28.11

20.24

Skew

1.42

-1.08

1.3

-1.39

Kurtosis

6.62

5.18

2.61

7.46

Expected Daily %

0.19%

0.03%

0.16%

0.12%

Expected Monthly %

5.45%

0.9%

2.53%

1.85%

Expected Yearly %

45.03%

6.51%

5.12%

3.74%

Daily Value-at-Risk

-1.75%

-1.1%

-1.4%

-1.11%

Expected Shortfall (cVaR)

-2.95%

-2.95%

-1.52%

-1.52%

Payoff Ratio

1.01

1.89

1.87

2.37

Profit Factor

0.78

0.17

0.81

0.77

Common Sense Ratio

1.34

0.16

1.39

2.55

CPC Index

0.41

0.18

0.76

1.2

Tail Ratio

1.71

0.92

1.71

3.29

Outlier Win Ratio

4.21

8.17

4.11

5.99

Outlier Loss Ratio

2.73

3.25

2.77

2.88

MTD

20.69%

-2.11%

0.74%

3.1%

3M

24.15%

2.05%

5.12%

3.74%

6M

33.7%

4.83%

5.12%

3.74%

YTD

45.03%

6.51%

5.12%

3.74%

1Y

45.03%

6.51%

5.12%

3.74%

Best Day

6.79%

2.18%

3.18%

1.72%

Worst Day

-4.31%

-3.54%

-1.52%

-2.78%

Best Month

20.69%

7.25%

4.35%

3.1%

Worst Month

-2.42%

-7.07%

0.74%

0.62%

Best Year

45.03%

6.51%

5.12%

3.74%

Worst Year

45.03%

6.51%

5.12%

3.74%

Avg. Drawdown

-1.7%

-1.45%

-1.16%

-1.24%

Avg. Drawdown Days

10

8

4

7

Recovery Factor

7.14

0.92

1.72

1.34

Table 3: Summary of Strategy 3 Treasury Futures Backtest

Treasury Futures

Treasury Futures Out of Sample

Start Period

05/02/2019

05/02/2019

21/08/2019

21/08/2019

End Period

21/08/2019

21/08/2019

20/09/2019

20/09/2019

Time in Market

68.0%

100%

68.0%

100%

Number of Trades

227

31

Cumulative Return

6.89%

7.09%

1.86%

-0.52%

CAGR%

13.14%

13.54%

25.13%

-6.17%

Sharpe

1.53

2.51

1.84

-0.86

Sortino

2.74

4.61

2.95

-1.22

Max Drawdown

-3.85%

-1.59%

-3.27%

-2.57%

Longest DD Days

105

56

4

16

Volatility (ann.)

5.63%

3.5%

8.35%

4.82%

Calmar

3.41

8.54

7.69

-2.4

Skew

0.98

0.92

0.2

0.28

Kurtosis

3.13

3.16

1.06

0.51

Expected Daily %

0.03%

0.03%

0.06%

-0.02%

Expected Monthly %

0.96%

0.98%

0.93%

-0.26%

Expected Yearly %

6.89%

7.09%

1.86%

-0.52%

Daily Value-at-Risk

-0.55%

-0.33%

-0.8%

-0.52%

Expected Shortfall (cVaR)

-0.75%

-0.75%

-1.12%

-1.12%

Payoff Ratio

2.18

2.56

0.86

1.61

Profit Factor

0.37

0.65

0.42

0.15

Common Sense Ratio

0.6

0.88

0.51

0.16

CPC Index

0.39

0.92

0.23

0.1

Tail Ratio

1.6

1.34

1.21

1.07

Outlier Win Ratio

5.08

7.58

3.6

5.96

Outlier Loss Ratio

2.15

3.38

1.45

2.99

MTD

3.53%

2.43%

-1.1%

-0.89%

3M

4.06%

5.01%

1.86%

-0.52%

6M

5.53%

6.94%

1.86%

-0.52%

YTD

6.89%

7.09%

1.86%

-0.52%

1Y

6.89%

7.09%

1.86%

-0.52%

Best Day

1.45%

1.05%

1.41%

0.7%

Worst Day

-1.05%

-0.57%

-1.12%

-0.63%

Best Month

3.53%

2.43%

2.99%

0.37%

Worst Month

-0.8%

-0.47%

-1.1%

-0.89%

Best Year

6.89%

7.09%

1.86%

-0.52%

Worst Year

6.89%

7.09%

1.86%

-0.52%

Avg. Drawdown

-0.72%

-0.39%

-1.1%

-1.11%

Avg. Drawdown Days

13

9

3

7

Recovery Factor

1.79

4.47

0.57

-0.2

Table 4: Summary of Strategy 2 EURUSD Backtest

EURUSD

EURUSD Out of Sample

Start Period

05/02/2019

05/02/2019

21/08/2019

21/08/2019

End Period

21/08/2019

21/08/2019

20/09/2019

20/09/2019

Time in Market

66.0%

100%

68.0%

100%

227

33

Cumulative Return

-2.28%

-2.77%

1.49%

-0.25%

CAGR%

-4.18%

-5.07%

19.77%

-3.02%

Sharpe

-0.4

-0.81

1.65

-0.44

Sortino

-0.63

-1.13

2.69

-0.65

Max Drawdown

-10.87%

-3.63%

-1.29%

-1.87%

Longest DD Days

187

153

15

25

Volatility (ann.)

6.81%

4.32%

7.46%

4.45%

R^2

0.01

0.01

0.0

0.0

Calmar

-0.38

-1.4

15.31

-1.61

Skew

1.21

0.21

0.41

0.37

Kurtosis

4.62

2.82

1.41

0.14

Expected Daily %

-0.01%

-0.01%

0.05%

-0.01%

Expected Monthly %

-0.33%

-0.4%

0.74%

-0.13%

Expected Yearly %

-2.28%

-2.77%

1.49%

-0.25%

Daily Value-at-Risk

-0.72%

-0.46%

-0.72%

-0.47%

Expected Shortfall (cVaR)

-0.87%

-0.87%

-0.98%

-0.98%

Payoff Ratio

1.25

1.88

1.05

2.14

Profit Factor

0.08

0.15

0.36

0.07

Common Sense Ratio

0.09

0.14

0.44

0.08

CPC Index

0.04

0.13

0.24

0.08

Tail Ratio

1.15

0.95

1.21

1.09

Outlier Win Ratio

5.83

8.82

3.66

5.78

Outlier Loss Ratio

2.18

3.53

1.31

2.56

MTD

-1.78%

0.3%

0.82%

0.74%

3M

3.43%

-0.54%

1.49%

-0.25%

6M

-4.71%

-1.76%

1.49%

-0.25%

YTD

-2.28%

-2.77%

1.49%

-0.25%

1Y

-2.28%

-2.77%

1.49%

-0.25%

Best Day

2.2%

0.94%

1.38%

0.65%

Worst Day

-1.08%

-0.94%

-0.98%

-0.5%

Best Month

3.9%

2.28%

0.82%

0.74%

Worst Month

-4.13%

-3.03%

0.67%

-0.99%

Best Year

-2.28%

-2.77%

1.49%

-0.25%

Worst Year

-2.28%

-2.77%

1.49%

-0.25%

Avg. Drawdown

-5.65%

-2.8%

-0.99%

-1.0%

Avg. Drawdown Days

96

98

8

13

Recovery Factor

-0.21

-0.76

1.16

-0.13

Table 5: Summary of Strategy 2 Gold Backtest

Gold

Gold out of Sample

Start Period

05/02/2019

05/02/2019

21/08/2019

21/08/2019

End Period

21/08/2019

21/08/2019

20/09/2019

20/09/2019

Time in Market

64.0%

100%

68.0%

100%

218

38

Cumulative Return

36.32%

14.25%

-8.83%

1.08%

CAGR%

77.55%

27.99%

-67.52%

13.95%

Sharpe

2.28

1.58

-3.87

0.8

Sortino

4.66

2.86

-4.54

1.21

Max Drawdown

-8.58%

-5.54%

-11.91%

-3.68%

Longest DD Days

97

113

16

15

Volatility (ann.)

17.97%

11.13%

18.94%

11.72%

Calmar

9.04

5.05

-5.67

3.79

Skew

1.57

1.67

-0.07

0.27

Kurtosis

5.97

9.05

0.35

2.27

Expected Daily %

0.16%

0.07%

-0.3%

0.03%

Expected Monthly %

4.53%

1.92%

-4.52%

0.54%

Expected Yearly %

36.32%

14.25%

-8.83%

1.08%

Daily Value-at-Risk

-1.7%

-1.08%

-2.25%

-1.18%

Expected Shortfall (cVaR)

-2.53%

-2.53%

-2.52%

-2.52%

Payoff Ratio

1.98

2.75

0.63

1.15

Profit Factor

0.7

0.4

0.53

0.17

Common Sense Ratio

1.43

0.51

0.39

0.16

CPC Index

0.7

0.56

0.13

0.12

Tail Ratio

2.04

1.29

0.72

0.92

Outlier Win Ratio

5.8

8.96

4.8

5.76

Outlier Loss Ratio

2.46

3.49

1.58

2.69

MTD

9.61%

6.37%

-10.28%

-0.37%

3M

35.57%

17.57%

-8.83%

1.08%

6M

34.04%

13.22%

-8.83%

1.08%

YTD

36.32%

14.25%

-8.83%

1.08%

1Y

36.32%

14.25%

-8.83%

1.08%

Best Day

5.5%

4.56%

2.33%

2.22%

Worst Day

-3.79%

-1.69%

-2.53%

-1.75%

Best Month

11.62%

8.15%

1.61%

1.45%

Worst Month

-3.38%

-1.68%

-10.28%

-0.37%

Best Year

36.32%

14.25%

-8.83%

1.08%

Worst Year

36.32%

14.25%

-8.83%

1.08%

Avg. Drawdown

-2.53%

-1.48%

-4.57%

-1.45%

Avg. Drawdown Days

14

15

7

6

Recovery Factor

4.23

2.57

-0.74

0.29

If you want to learn various aspects of Algorithmic trading then check out the Executive Programme in Algorithmic Trading (EPAT®). The course covers training modules like Statistics & Econometrics, Financial Computing & Technology, and Algorithmic & Quantitative Trading. EPAT equips you with the required skill sets to build a promising career in algorithmic trading. Enroll now!

Disclaimer: The information in this project is true and complete to the best of our Student’s knowledge. All recommendations are made without guarantee on the part of the student or QuantInsti®. The student and QuantInsti® disclaim any liability in connection with the use of this information. All content provided in this project is for informational purposes only and we do not guarantee that by using the guidance you will derive a certain profit./overseas

Advanced Algorithmic Trading Course