TSF (Time Series Forecast)

Modified on 2009/06/09 07:44 by Eugene — Categorized as: Community Indicators

Time Series Forecast: Indicator Documentation

Syntax


DataSeries TSF( DataSeries ds, int period, int ProjectionBar )

Parameter Description

ds Data series
period Indicator lookback period
ProjectionBar Project results by this number of bars into the future (negative) or past (positive). The default value is 0.

Description

The Time Series Forecast indicator displays the statistical trend of price over a specified lookback period based on linear regression analysis. The Time Series Forecast uses the last point of multiple linear regression trendlines, thereby acting as a "moving linear regression" line.

Compared to a moving average of price, Time Series Forecast (TSF) has noticeably less lag. Since the indicator is continuously "fitting" itself to the data instead of averaging, this makes the Time Sseries Forecast more responsive to short term price changes. In essence, it's a straight line drawn through the given number of recent price points and projected forward.

Interpretation

Typically, Time Series Forecast can be used in the manner of a responsive moving average. In addition, the indicator can be used to forecast the next period's price.

Example

This example illustrates how to plot the Time Series Forecast indicator.


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using Community.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { TSF tsf = TSF.Series( Close, 14, -2 ); PlotSeries( PricePane, tsf, Color.Blue, LineStyle.Solid, 1 );

} } }