How to Calculate and Trade With the TSF

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?

Linear Regression Extension on GBPUSD forex pairThe 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.

TSF Indicator on GBPUSD Forex PairUnlike the linear regression line, the TSF is recalculated each bar. This means that it looks like a moving average and can be used in a similar way.

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 am going to 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 historic data. In this example I am going to use the GBP/USD. The close data is in Column F and the TSF will be 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:

TSF Calculation in Excel

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 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 fomulas 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 are based in Excel and allow anyone to test trading strategies. I wanted to have a look at how the TSF has performed as a trade entry signal for the GBP/USD pair.

I wanted 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

Gross Losing Trades $-215,955
Net Profit $57,113
Profit Factor1.26
Winning Trades141
Losing Trades204
Percentage Winning Trades40.9%
Average Winning Trade1,937
Average Losing Trade-1,059
Largest Winning Trade $7,213
Largest Losing Trade $-3,880
Max Drawdown14.9%

Conclusion

The results show that the TSF has been reasonably good at identifying trading opportunities over the time period of the assessment. The average winning trade is almost twice as high as the average losing trade. This makes up for the fact that the strategy only has just over 40% winning trades.

Video