OPEN-SOURCE SCRIPT

Forward-Backward Exponential Oscillator [LuxAlgo]

4852
The Forward-Backward Exponential Oscillator is a normalized oscillator able to estimate directional shifts by making use of a unique "Forward-Backward Filtering" calculation method for Exponential Moving Averages (EMAs).

This unique method provides a smooth normalized representation of the price with reduced lag.

🔶 USAGE

snapshot

The oscillator consists of 2 series of values derived from normalizing the sum of each EMA's change across the selected user lookback window (length), one less reactive computed forward (in grey), and the other re-calculated backward for each bar (in blue).

Given this "Forward-Backwards" calculation method, we are able to produce a more reactive oscillator compared to the same operation done on a simple double-smoothed EMA.

The interaction between these 2 values (Forward Value and Backward Value) can highlight shifts in market momentum over time.

snapshot

When the Forward Value is above the Backward Value, the price is seen moving up, and likewise, when the Forward EMA is below, the Backward EMA price is seen moving down.

The indicator specifically displays the difference between values through a histogram located at the 50 mark on the oscillator.

🔹 Projection

snapshot

We project the approximated future values of the forward value in front of the current line. This helps show the data that is being used for the creation of the Forward Value.

🔹 Length & Smoothing

  • The Smoothing Input controls the length of the EMAs which are analyzed.
  • The Length Input controls the lookback for the sum of changes from the EMAs.


Displayed below is a comparison of varying input sizes and their results.

snapshot

As seen above:

A larger length input will result in slower, gradual movement by the oscillator since the summed values are from a larger lookback.

A higher smoothing setting will result in smoother EMAs, leading to a smoother oscillator output that is less contaminated by noisy variations.

Note: The length of the projection is tied to the "length" input, to get a longer projection, a larger length is required.

🔶 DETAILS

Forward-backward filtering is a method applied to LTI (linear time-invariant) filters to provide a filter response with zero-phase shift, this has the visible effect of shifting a regular causal filter response to the right, making it appear has have effectively 0 lag.

The name of this operation indicates that the filter is first calculated forward over a series of values (like regular moving averages), then calculated backward, using the previous output as input for the filter, effectively applying the filter twice.

While this operation effectively allows us to obtain a zero-lag response when applied to an EMA, it is subject to repainting, as this indicator only returns the normalized sum of changes of the forward-backward EMA, which does not introduce any repainting behaviors in the final output of the oscillator.

🔶 SETTINGS

  • Length: Change the calculation lookback length for the oscillator.
  • Smoothing: Alter the smoothness of the back-end EMA calculations.
  • Source: Change the source input used for the indicator.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.