OPEN-SOURCE SCRIPT

TASC 2024.10 Adaptive Oscillator Threshold

Por PineCodersTASC
█ OVERVIEW

This script introduces a more dynamic approach to generating trading signals using the RSI indicator and a threshold that adapts to price trends and dispersion. This methodology comes from Francesco Bufi's article "Overbought/Oversold Oscillators: Useless Or Just Misused" from the October 2024 edition of TASC's Traders' Tips.


█ CONCEPTS

According to Francesco Bufi's observations, an oscillator-based buy signal should have a threshold that varies with the trend direction: higher during uptrends and lower during downtrends. Additionally, the level should decrease as the distance from the price to its mean increases to reduce signals in volatile conditions. Accordingly, Bufi proposes a formula for an adaptive buy level whose value is proportional to the trend (linear regression slope) and inversely proportional to the typical distance between price and its mean (standard deviation). Traders can apply this method to any oscillator to add adaptivity without modifying the oscillator's calculations, as it's simply an adaptive technique for interpreting the calculated values.

This script demonstrates the application of Bufi's Adaptive Threshold (BAT) in a simple RSI-based strategy and allows users to compare its performance to the traditional fixed-threshold approach. Bufi's observations suggest that using the BAT instead of a static threshold can help improve the backtest performance of oscillator-based systems.


█ DISCLAIMER

This strategy script educates users on the trading systems outlined by the TASC article. By default, it uses 10% of equity as the order size and a slippage amount of 5 ticks. Traders should adjust these settings and the commission amount when using this script.
Centered OscillatorsRelative Strength Index (RSI)tascthreshold
PineCodersTASC
Tools and ideas for all Pine coders: tradingview.com/u/PineCoders/
Pine news broadcasts: t.me/PineCodersSquawkBox or twitter.com/PineCoders
TASC: traders.com/

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal