# Time-Series-Forecast (TSF)

#### Description <a href="#description_110" id="description_110"></a>

The Time-Series-Forecast is quite similar to a moving average. Here, the trend is established based on a regression equation that uses the smallest square formula. The goal of the TSF is to anticipate future price movements with the help of currently existing data.

#### Interpretation <a href="#interpretation_58" id="interpretation_58"></a>

The TSF reacts faster than the moving averages. These always have time delays when depicting the pre-existing trends. The TSF formula never allows the distance to the current price to become too large, thus permitting sharper trade reversal recognition.

An entry is placed when the price breaks the TSF line from bottom to top.

#### Further information <a href="#further-information_43" id="further-information_43"></a>

<http://en.wikipedia.org/wiki/Time_series>

#### Usage <a href="#usage_105" id="usage_105"></a>

```csharp
TSF(int forecast, int period)
TSF(IDataSeries inSeries, int forecast, int period)
TSF(int forecast, int period)[int barsAgo]
TSF(IDataSeries inSeries, int forecast, int period)[int barsAgo]
```

#### Return value <a href="#return-value_103" id="return-value_103"></a>

**double**

When using this method with an index (e.g. **TSF**(3,14)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_97" id="parameters_97"></a>

forecast Number of bars used for the forecast

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_101" id="visualization_101"></a>

![Time-Series-Forecast (TSF)](https://agenatrader.github.io/AgenaIndicator-documentation/media/TSF.jpg)

#### Example <a href="#example_100" id="example_100"></a>

```csharp
//Output the TSF values
Print("The current value for the TSF is: " + TSF(3, 14)[0]);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://indicators.agenatrader.com/standard-indicators/time-series-forecast-tsf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
