Advanced Dynamic Threshold RSI Indicator 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 Dynamic Thresholds: The indicator calculates dynamic thresholds based on market volatility, providing more adaptive signal generation. Performance Analysis: Users can evaluate recent price performance to further refine signals. The script calculates the percentage change over a specified lookback period. Bollinger Bands Integration: Optional integration of Bollinger Bands for additional confirmation and visualization of potential overbought or oversold conditions. Customizable Settings: Traders can easily customize key parameters, including RSI length, SMA length, lookback bars, threshold multiplier, and Bollinger Bands parameters. Weighted Signals: The script introduces a unique weighting mechanism for signals, reducing false positives and improving overall reliability. 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 * volatility1D 3.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 crossUnder1H These 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: RSI values for different timeframes (1-hour, 4-hour, and 1-day) often exhibit different scales, especially in markets like gold. Attempting to display these RSIs on the same chart can lead to visibility issues, as the scaling differences may cause certain RSI lines to appear compressed or nearly invisible. 2. Candlestick Visibility vs. RSI Scaling: Balancing the visibility of candlestick patterns with that of RSI values posed a unique challenge. A single pane for both candlesticks and RSIs may compromise the clarity of either, particularly when dealing with assets that exhibit distinct volatility patterns. Design Solution Placing the buy/sell signals above/below the candles helps to maintain a clear association between the signals and price movements. By allocating RSIs beneath the main chart, users can better distinguish and analyze the RSI values without interference from candlestick scaling. Doubling the scaling of the 1-hour RSI (displayed in blue) addresses visibility concerns and ensures that it remains discernible even when compared to the other two RSIs: 4-hour RSI (orange) and 1-day RSI (green). Bollinger Bands Module is optional, but is turned on as default. When the module is turned on, the users can see the upper Bollinger Band (green) and lower Bollinger Band (red) on the main chart to gain more insight into price actions of the candles. User Flexibility This dual-placement approach offers users the flexibility to choose their preferred visualization: The main chart provides a comprehensive view of buy/sell signals in relation to candlestick patterns. The area beneath the chart accommodates a detailed examination of RSI values, each in its own timeframe, without compromising visibility. 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: Open the TradingView platform. Navigate to the "Indicators" tab in the top menu. Click on "Community Scripts" and search for "Advanced Dynamic Threshold RSI Indicator." Select the indicator from the search results and click on it to add to your chart. 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 Open TradingView and navigate to the Pine Editor. Copy the provided script. Paste the script into the Pine Editor. Click "Add to Chart." Configuration The indicator offers several customizable settings: RSI Length: Defines the length of the RSI calculation. SMA Length: Sets the length of the SMA applied to the RSI. Lookback Bars: Determines the number of bars used for recent performance analysis. Threshold Multiplier: Adjusts the multiplier for dynamic threshold calculation. Enable Bollinger Bands: Allows users to enable or disable Bollinger Bands integration. Interpreting Signals Buy Signal: Generated when RSI values are above dynamic thresholds and a crossover occurs. Sell Signal: Generated when RSI values are below dynamic thresholds and a crossunder occurs. Additional Information The indicator plots scaled RSI lines for 1-hour, 4-hour, and 1-day timeframes. Users can experiment with additional modules, such as machine-learning simulation, dynamic real-life improvements, or experimental signal filtering, depending on personal preferences. 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. Kind regards, Ely
I do apologize because I forgot to share all the code. Here is the full source code: OPEN SOURCE CODE // This Pine Scriptâ„¢ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ Thank you very much. My IRL job is management, but in my personal life, I often write indicators to friends or simply traders in need. I learned this skill from our quant developers. I like to keep a personal touch with the employees. This indicator is my work alone. Then, about sharing. I don't believe that my trading profit depends on a secret. I'd consider that a weak security. I think my profit is based on my bots being faster than of others. I can share my strategies without worries.
Surprise. It does not work realtime tracking out of sample any good because you forgot to internalize the fundamentals. Therefore you need to look at other markets too. No market can be examined isolated, the whole market has many dependencies. You must be new to financial markets, otherwise you would know this and had a much different code to share. My two cents.
One more thing before you are running against a wall. You should know that coding and testing (time) is not the bottleneck in trading from my experience. It is all about idea creation and understanding the markets which takes the most time. No AI or ML model can replace this as I know and have experienced so far.
Because I usually use many scripts, like 24-49 indicators, but according to TV compliance, I couldn't include any indicator on the chart that isn't necessary to interpret mine. People usually don't mind the space, but if it's an obstacle, you can resize the indicators of the script. I can assist you with that. You can fill the "dead space" your colleague mentioned above with additional charts of different markets.
No thanks, I've got what I use for a long time. In my case bars (actual price) matter more than anything else added. Just was curious why do that. To each their own.
Bars/Actual price matters to me, too. To release the script, I had to emphasize some indicators and exclude others, but it's not like I ignored your bars. What's more, that's the reason I made it open source. People can grab the code and add their own. Actual price indicators if they wish. Nevertheless, I know many like indicators on actual price bars. It isn't such a script, but I could write one such script. I only argue "To each their own." I'm of the people, by the people, for the people! Do you have any favorite indicators related to the actual price you believe I should examine and learn?
I don't know - you can't see how scrunched up bars are at the top unneccesarily and all that empty wasted space in the middle? I'm constantly adjusting my charts to best see what I need to see. Anyway the one indicator I prioritize with price (along with time, pattern and momentum) is Rate of Change unfiltered. Just price divided by price x number of bars ago X 100. Below one minute ES chart from Friday ROC set to length of 60 representing price change over an hour. Notice divergence around lunch hour. I doubt I would have ever seen that with a chart with price squeezed on top and indicator on bottom. Just sayin'