OPEN-SOURCE SCRIPT

RSI Weighted Trend System I [InvestorUnknown]

업데이트됨
The RSI Weighted Trend System I is an experimental indicator designed to combine both slow-moving trend indicators for stable trend identification and fast-moving indicators to capture potential major turning points in the market. The novelty of this system lies in the dynamic weighting mechanism, where fast indicators receive weight based on the current Relative Strength Index (RSI) value, thus providing a flexible tool for traders seeking to adapt their strategies to varying market conditions.

Dynamic RSI-Based Weighting System
  • The core of the indicator is the dynamic weighting of fast indicators based on the value of the RSI. In essence, the higher the absolute value of the RSI (whether positive or negative), the higher the weight assigned to the fast indicators. This enables the system to capture rapid price movements around potential turning points.


Users can choose between a threshold-based or continuous weight system:
  • Threshold-Based Weighting: Fast indicators are activated only when the absolute RSI value exceeds a user-defined threshold. Below this threshold, fast indicators receive no weight.
  • Continuous Weighting: By setting the weight threshold to zero, the fast indicators always receive some weight, although this can result in more false signals in ranging markets.




스냅샷


Slow and Fast Indicators
Slow Indicators are designed to identify stable trends, remaining constant in weight. These include:
  • DMI (Directional Movement Index) For Loop
  • CCI (Commodity Channel Index) For Loop
  • Aroon For Loop

Fast Indicators are more responsive and designed to spot rapid trend shifts:
  • ZLEMA (Zero-Lag Exponential Moving Average) For Loop
  • IIRF (Infinite Impulse Response Filter) For Loop


Each of these indicators is calculated using a for-loop method to generate a moving average, which captures the trend of a given length range.


RSI Normalization
  • To facilitate the weighting system, the RSI is normalized from its usual 0-100 range to a -1 to 1 range. This allows for easy scaling when calculating weights and helps the system adjust to rapidly changing market conditions.




Signal Calculation
  • The final trading signal is a weighted average of both the slow and fast indicators, depending on the calculated weights from the RSI. This ensures a balanced approach, where slow indicators maintain overall trend guidance, while fast indicators provide timely entries and exits.





Backtest Mode and Performance Metrics
This version of the RSI Weighted Trend System includes a comprehensive backtesting mode, allowing users to evaluate the performance of their selected settings against a Buy & Hold strategy. The backtesting includes:
  • Equity calculation based on the signals generated by the indicator.
  • Performance metrics table comparing Buy & Hold strategy metrics with the system’s signals, including: Mean, positive, and negative return percentages, Standard deviations (of all, positive and negative returns), Sharpe Ratio, Sortino Ratio, and Omega Ratio




The metrics help traders assess the effectiveness of their strategy over time and can be used to optimize their settings.

스냅샷


Calibration Mode
  • A calibration mode is included to assist users in tuning the indicator to their specific needs. In this mode, traders can focus on a specific indicator (e.g., DMI, CCI, Aroon, ZLEMA, IIRF, or RSI) and fine-tune it without interference from other signals.
  • The calibration plot visualizes the chosen indicator's performance against a zero line, making it easy to see how changes in the indicator’s settings affect its trend detection.



Customization and Default Settings
  • Important Note: The default settings provided are not optimized for any particular market or asset. They serve as a starting point for experimentation. Traders are encouraged to calibrate the system to suit their own trading strategies and preferences.
  • The indicator allows deep customization, from selecting which indicators to use, adjusting the lengths of each indicator, smoothing parameters, and the RSI weight system.



Alerts
Traders can set alerts for both long and short signals when the indicator flips, allowing for automated monitoring of potential trading opportunities.
릴리즈 노트
- Fixed issue with indicator giving errors on lower timeframes (the issue may still persist if you are using backtest mode on lower timeframes and referencing more than 5000 bars, in which case you will have to change the Backtest Start Date for the backtest tool to work.)
educationalstatisticsTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항