# Forecast Oscillator (FOSC)

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

The FOSC makes a comparison of the current price against the value returned by the Time Series Forecast study. It is calculated as a percentage ratio of the difference between the close price and the Time Series Forecast value for the previous bar.

When this oscillator displays positive values, it hints that the Time Series Forecast has underestimated the price, whereas negative values suggest that the TSF has overestimated the price. Usually, an SMA also accompanies the Forecast Oscillator line in the search for oscillator reversals.

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

FMLabs: <http://www.fmlabs.com/reference/default.htm?url=ForecastOscillator.htm>

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

inSeries Input data series for the indicator

period Number of bars included in the calculations

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

**double**

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

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

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

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

![Forecast Oscillator (FOSC)](https://agenatrader.github.io/AgenaIndicator-documentation/media/FOSC.jpg)

#### Examples <a href="#examples" id="examples"></a>

```csharp
//Output for the Forecast Oscillator
Print("The current value for the Forecast Oscillator is: " + FOSC(14)[0]);

//Determining the future market direction
if (FOSC(14)[0] > 0)
Print("The FOSC is bigger than zero, which indicates rising price movements.");
```


---

# 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/forecast-oscillator-fosc.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.
