> For the complete documentation index, see [llms.txt](https://indicators.agenatrader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://indicators.agenatrader.com/standard-indicators/forecast-oscillator-fosc.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://indicators.agenatrader.com/standard-indicators/forecast-oscillator-fosc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
