Login Register






Poll: How do you feel about my indicator? (Public)
You do not have permission to vote in this poll.
I love it.
100.00%
1 100.00%
I'll give you a better one.
0%
0 0%
I don't even know what's going on.
0%
0 0%
Total 1 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average


Trading Script: Advanced Dynamic Threshold RSI Indicator [PineScript, OpenSource] filter_list
Author
Message
Trading Script: Advanced Dynamic Threshold RSI Indicator [PineScript, OpenSource] #1
Advanced Dynamic Threshold RSI Indicator

[Image: Advanced-RSI.png]

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

  1. Dynamic Thresholds: The indicator calculates dynamic thresholds based on market volatility, providing more adaptive signal generation.
  2. Performance Analysis: Users can evaluate recent price performance to further refine signals. The script calculates the percentage change over a specified lookback period.
  3. Bollinger Bands Integration: Optional integration of Bollinger Bands for additional confirmation and visualization of potential overbought or oversold conditions.
  4. Customizable Settings: Traders can easily customize key parameters, including RSI length, SMA length, lookback bars, threshold multiplier, and Bollinger Bands parameters.
  5. 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:

  1. Open the TradingView platform.
  2. Navigate to the "Indicators" tab in the top menu.
  3. Click on "Community Scripts" and search for "Advanced Dynamic Threshold RSI Indicator."
  4. 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

  1. Open TradingView and navigate to the Pine Editor.
  2. Copy the provided script.
  3. Paste the script into the Pine Editor.
  4. 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.

(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-Scrip...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-Scrip...pid1338779

Kind regards,
Ely
(This post was last modified: 12-31-2023, 12:59 AM by ElysianSignals. Edit Reason: Added related indicators )

Reply







Users browsing this thread: 1 Guest(s)