![]() |
|
Trading Script: Advanced Dynamic Threshold RSI Indicator [PineScript, OpenSource] - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Coding (https://sinister.li/Forum-Coding--71) +--- Thread: Trading Script: Advanced Dynamic Threshold RSI Indicator [PineScript, OpenSource] (/Thread-Trading-Script-Advanced-Dynamic-Threshold-RSI-Indicator-PineScript-OpenSource) |
Trading Script: Advanced Dynamic Threshold RSI Indicator [PineScript, OpenSource] - ElysianSignals - 12-16-2023 Advanced Dynamic Threshold RSI Indicator
![]() My Open-Source Pine Indicator Used In My Trading Scenarios
Exclusive message to the Sinisterly Community Dear Esteemed Sinisterly Members, I believe that you all deserve full control over the signals you use in your trading strategies. With my indicator, you don't have to rely on any unknown signal provider or shady exchange. Probably, no one read my introduction post on this forum, so, let me tell you something. The exchanges whose registration I financed are all compliant exchanges up to this day, but statistically, customers keep losing much more than they could afford despite the exchanges not pulling any typical fraud. According to my research, more money is burned in legit trading than stolen in a typical rogue feat like rug pulls. My experience says never trade with more money than what you're willing to lose, whether it's gold coins, "digital gold," or otherwise. Until you acquire your financial freedom, you can consider holding in cold wallets like an explosion-proof vault upstairs for your gold bars or hardware wallets for crypto. But I don't say not to trade. You can always have fun without risking your living - on paper, in Excel sheets, or running simulations. I opened the source code to give you an authentic insight into the calculations for making your signals as transparent as possible. You can generate as many signals as you want and will always know promptly why your AI believes what it suggests. This difference empowers you to cross-check your AI's results with your investment experience. Here, I'm writing about an original Pine script I made called Advanced Dynamic Threshold RSI Indicator. It's a special RSI code to generate signals featuring simulated machine learning (ML) like Smart Weighting, Noise Filtering, Volatility Adaptation, Tactical Threshold, and Performance Tracing. With the configuration block, the indicator cross-checks RSI results with Bollinger Bands to visualize trading signals. I released my different trading indicators some days ago (Adaptive MFT Extremum Pivots [PineScript, OpenSource]), and a few of you wrote in the feedback you wanted to try more indicators I developed. I wrote some open-source indicators because you want a seamless method to use them in your market analytics. You can add them to your charts universally on any market. I use - among others - the same open source indicators in my analyst AI. That's why you find it as a reference in multiple AI insights I shared in my public track record. Happy trading! Overview The Advanced Dynamic Threshold RSI Indicator is a powerful tool designed for traders seeking a unique approach to RSI-based signals. This indicator combines traditional RSI analysis with dynamic threshold calculation and optional Bollinger Bands to generate weighted buy and sell signals. Features
Underlying Calculations and Methods 1. Dynamic Threshold Calculation: The heart of the Advanced Dynamic Threshold RSI Indicator lies in its ability to dynamically calculate thresholds based on multiple timeframes. Let's delve into the technical details: RSI Calculation: For each specified timeframe (1-hour, 4-hour, 1-day, 1-week), the Relative Strength Index (RSI) is calculated using the standard 14-period formula. SMA of RSI: The Simple Moving Average (SMA) is applied to each RSI, resulting in the smoothing of RSI values. This smoothed RSI becomes the basis for dynamic threshold calculations. Dynamic Adjustment: The dynamically adjusted threshold for each timeframe is computed by adding a constant value (5 in this case) to the respective SMA of RSI. This dynamic adjustment ensures that the threshold reflects changing market conditions. 2. Weighted Signal System: To enhance the precision of buy and sell signals, the script introduces a weighted signal system. Here's how it works technically: Signal Weighting: The script assigns weights to buy and sell signals based on the crossover and crossunder events between RSI and the dynamically adjusted thresholds. If a crossover event occurs, the weight is set to 2; otherwise, it remains at 1. Signal Combination: The weighted buy and sell signals from different timeframes are combined using logical operations. A buy signal is generated if the product of weights from all timeframes is equal to 2, indicating alignment across timeframe. 3. Experimental Enhancements: The Advanced Dynamic Threshold RSI Indicator incorporates experimental features for educational exploration. While not intended as proven strategies, these features aim to offer users a glimpse into unconventional analysis. Some of these features include Performance Calculation, Volatility Calculation, Dynamic Threshold Calculation Using Volatility, Bollinger Bands Module, Weighted Signal System Incorporating New Features. 3.1 Performance Calculation: The script calculates the percentage change in the price over a specified lookback period (variable lookbackBars). This provides a measure of recent performance. Code: pctChange(src, length) =>
change = src - src[length]
pctChange = (change / src[length]) * 100
recentPerformance1H = pctChange(close, lookbackBars)
recentPerformance4H = pctChange(request.security(syminfo.tickerid, "240", close), lookbackBars)
recentPerformance1D = pctChange(request.security(syminfo.tickerid, "1D", close), lookbackBars)3.2 Volatility Calculation: The script computes the standard deviation of the closing price to measure volatility. Code: volatility1H = ta.stdev(close, 20)
volatility4H = ta.stdev(request.security(syminfo.tickerid, "240", close), 20)
volatility1D = ta.stdev(request.security(syminfo.tickerid, "1D", close), 20)3.3 Dynamic Threshold Calculation Using Volatility: The dynamic thresholds for RSI are calculated by adding a multiplier of volatility to 50. Code: dynamicThreshold1H = 50 + thresholdMultiplier * volatility1H
dynamicThreshold4H = 50 + thresholdMultiplier * volatility4H
dynamicThreshold1D = 50 + thresholdMultiplier * volatility1D3.4 Bollinger Bands Module: An additional module for Bollinger Bands is introduced, providing an option to enable or disable it. Code: // Additional Module: Bollinger Bands
bbLength = input(20, title="Bollinger Bands Length")
bbMultiplier = input(2.0, title="Bollinger Bands Multiplier")
upperBand = ta.sma(close, bbLength) + bbMultiplier * ta.stdev(close, bbLength)
lowerBand = ta.sma(close, bbLength) - bbMultiplier * ta.stdev(close, bbLength)3.5 Weighted Signal System Incorporating New Features: Buy and sell signals are generated based on the dynamic threshold, recent performance, and Bollinger Bands. Code: weightedBuySignal = rsi1H > dynamicThreshold1H and rsi4H > dynamicThreshold4H and rsi1D > dynamicThreshold1D and crossOver1H
weightedSellSignal = rsi1H < dynamicThreshold1H and rsi4H < dynamicThreshold4H and rsi1D < dynamicThreshold1D and crossUnder1HThese features collectively aim to provide users with a more comprehensive view of market dynamics by incorporating recent performance and volatility considerations into the RSI analysis. Users can experiment with these features to explore their impact on signal accuracy and overall indicator performance. Indicator Placement for Enhanced Visibility Overview The design choice to position the "Advanced Dynamic Threshold RSI" indicator both on the main chart and beneath it has been carefully considered to address specific challenges related to visibility and scaling, providing users with an improved analytical experience. Challenges Faced 1. Differing Scaling of RSI Results:
2. Candlestick Visibility vs. RSI Scaling:
Design Solution
User Flexibility
The chosen design optimizes visibility and usability, addressing the unique challenges posed by differing RSI scales and ensuring users can make informed decisions based on both price action and RSI dynamics. Usage Installation To ensure you receive updates and enhancements seamlessly, follow these steps:
This ensures that any future updates to the indicator can be easily applied, keeping you up-to-date with the latest features and improvements. Review Code
Configuration The indicator offers several customizable settings:
Interpreting Signals
Additional Information
Conclusion The Advanced Dynamic Threshold RSI Indicator provides traders with a sophisticated tool for RSI-based analysis, offering a unique combination of dynamic thresholds, performance analysis, and optional Bollinger Bands integration. Traders can customize settings and experiment with additional modules to tailor the indicator to their trading strategy. Disclaimer: Use of the Advanced Dynamic Threshold RSI Indicator The Advanced Dynamic Threshold RSI Indicator is provided for educational and experimental purposes only. The indicator is not intended to be used as financial or investment advice. Trading and investing in financial markets involve risk, and past performance is not indicative of future results. The creator of this indicator is not a financial advisor, and the use of this indicator does not guarantee profitability or specific trading outcomes. Users are encouraged to conduct their own research and analysis and, if necessary, consult with a qualified financial professional before making any investment decisions. It is important to recognize that all trading involves risk, and users should only trade with capital that they can afford to lose. The Advanced Dynamic Threshold RSI Indicator is an experimental tool that may not be suitable for all individuals, and its effectiveness may vary under different market conditions. By using this indicator, you acknowledge that you are doing so at your own risk and discretion. The creator of this indicator shall not be held responsible for any financial losses or damages incurred as a result of using the indicator. (You can verify that it's a direct link to TradingView via tracing services like wheregoes (dot) com. It's a public and open-source page you can check yourself.)
RELATED INDICATORS If you like, check out my Sinisterly trading scripts: Trading Script: Adaptive MFT Extremum Pivots [PineScript, OpenSource] The Adaptive MFT Extremum Pivots indicator, developed by Elysian_Mind (me), is a powerful Pine Script tool that dynamically displays key market levels, including Monthly Highs/Lows, Weekly Extremums, Pivot Points, and dynamic Resistances/Supports. The term "dynamic" emphasizes the adaptive nature of the calculated levels, ensuring they reflect real-time market conditions https://sinister.ly/Thread-Trading-Script-Adaptive-MFT-Extremum-Pivots-PineScript-OpenSource Trading Script: Divider MFT Persistent [PineScript, OpenSource] The "Divider MFT Persistent" indicator, developed by Elysian_Mind, is a versatile TradingView script designed to visually represent separators for different time intervals on the chart. This script aids traders in customizing their trading week parameters, allowing for a more personalized analysis of price movements. https://sinister.ly/Thread-Trading-Script-Divider-MFT-Persistent-PineScript-OpenSource?pid=1338779#pid1338779 Kind regards, Ely |