#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

## Forecast Oscillator

by Brian Brown, 4932 days ago

The Forecast Oscillator is a technical indicator that compares a security close price to its time series forecast. The time series forecast function name is "tsf" (already implemented in QuantShare) and it calculates the projection of the price trend for the next bar.

The Forecast Oscillator and therefore the time series forecast are based on linear regression. The time series forecast indicator is equal to the sum of two other indicators: the linear regression (LinearReg) and the linear regression slope (LinearReg_Slope).

If the Forecast Oscillator stays above the zero line for an extended period, then it signals that the price may rise in the future and if it stays below the zero line for an extended period, then it signals a coming fall in the security price.

The indicator name is "ForecastOsc" and it accepts two arguments. The first argument is the time series that is used in the next bar forecast (It is usually the close price) and the second one is the period that will be passed to the time series forecast function during calculation (Example: 10). The technical analysis indicator returns a value in percentage that corresponds to the close price minus the previous value of the time series forecast, multiplied by 100 and divided by the close price.

Example:

To calculate the time series forecast of a stock:

a = tsf(25); // Calculation is based on the previous 25 bars (a month approximately)

Note: Time series forecast indicator is different from the forecast oscillator. Read the first paragraph for more information.

Screen Example:

Returns stocks whose forecast oscillator is above 0 for at least 10 bars and displays the forecast oscillator and time series forecast indicator for each stock:

fo1 = ForecastOsc(close, 25);
filter = istrue(fo1 > 0, 10);

Market forecast indicator:

The next formula can be used in a composite item (Tools -> Composite in QuantShare main menu) to calculate the market forecast indicator.
It calculates the forecast oscillator of stocks listed in U.S exchanges, and then returns the average value for each trading bar.

composite = ForecastOsc(close, 25);

Settings: Calculate the average of the values added to the composite

What is this?

 Type: Trading Indicator Object ID: 926 Country: All Market: All Style: Technical Analysis

 Related objects Empty
Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object