OPEN-SOURCE SCRIPT

TASC 2024.10 Adaptive Oscillator Threshold

By 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/

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعد‎‎قوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟

إخلاء المسؤولية