# How to Calculate and Trade With the TSF

Last Updated on August 19, 2021 by Mark Ursell

The Time Series Forecast (TSF) indicator uses the Linear Regression to predict the future price. In this article, I show how you can calculate the TSF in Excel. I also show how you can use the TSF to trade the GBP/USD forex pair.

### What is the TSF Indicator?

The TSF indicator is based on an extension of the linear regression line. The linear regression calculates the best fit straight line through a series of data. The chart shown here shows the linear regression line and a dotted extension.

You can see how the line is a very good fit through the past data.

Unlike the linear regression line, the TSF is recalculated for each bar. This means that it looks like a moving average and you can use it similarly

Because the TSF is fitting to the data rather than averaging it, it tends to move more quickly than moving averages.

### How to Calculate the TSF

I will be calculating the TSF based on the Close Price. In this example, I will use a 20 period lookback period and a 1 period forecast period. This means that the current TSF will be trying to predict the close of the following period.

To start we need some historical data. In this example, I am going to use the GBP/USD. The close price data is in Column F and the TSF is calculated in Column G.

#### Step 1

Firstly we need to enter the number of lookback periods and the forecast period.

Cell G2 =20
Cell G3 =1

#### Step 2

Then we need to have a number series that counts 20 values from 0 to 19. In my spreadsheet, I am entering them in cells G182:G201.

Cells G182:G201 =0,1,2,3…19

The spreadsheet should now look like this:

#### Step 3

Enter the TSF formula. Excel makes this very easy because it has a built-in function that does the work. The function is called =FORECAST. In my spreadsheet, I am entering the first TSF calculation in Cell G205. I am referring to the values in cells G2, G3 and G182:G201.

Cell G205 =FORECAST(\$G\$2+G\$3-1,F186:F205,\$G\$182:\$G\$201)

#### Step 4

Copy the formulas down to the cells below by double-clicking on the bottom right-hand corner of Cell G205.

For more guidance on how to calculate the TSF, check out the video below.

### How to Trade with the TSF

Tradinformed Backtest Spreadsheets use Excel and they let you test a vast range of trading strategies. I want to have a look at how the TSF has performed as a trade entry signal for the GBP/USD pair.

I want to test how well this indicator performs on its own. Without any filters, stops or targets. In this test, I bought when the price was greater than the TSF and sold when the price was lower than the TSF. I used the GBP/USD close price from 2008-2016 on the daily timeframe. I did not test a stop-loss or profit target.

#### Results

Net Profit \$57,113
Profit Factor1.26