OPEN-SOURCE SCRIPT

TrigWave Suite [InvestorUnknown]

The TrigWave Suite combines Sine-weighted, Cosine-weighted, and Hyperbolic Tangent moving averages (HTMA) with a Directional Movement System (DMS) and a Relative Strength System (RSS).

Hyperbolic Tangent Moving Average (HTMA)
  • The HTMA smooths the price by applying a hyperbolic tangent transformation to the difference between the price and a simple moving average. It also adjusts this value by multiplying it by a standard deviation to create a more stable signal.




Sine-Weighted Moving Average (SWMA)
  • The SWMA applies sine-based weights to historical prices. This gives more weight to the central data points, making it responsive yet less prone to noise.




Cosine-Weighted Moving Average (CWMA)
  • The CWMA uses cosine-based weights for data points, which produces a more stable trend-following behavior, especially in low-volatility markets.




Directional Movement System (DMS)
  • DMS is used to identify trend direction and strength based on directional movement. It uses ADX to gauge trend strength and combines +DI and -DI for directional bias.




Relative Strength System (RSS)
  • RSS employs RSI and an adjustable moving average type (SMA, EMA, or HMA) to evaluate whether the market is in a bullish or bearish state.




ATR Adjustments
  • To minimize false signals, the HTMA, SWMA, and CWMA signals are adjusted with an Average True Range (ATR) filter:




  • This adjustment allows for better adaptation to varying market volatility, making the signal more reliable.


Signals and Trend Calculation
  • The indicator generates a Trend Signal by aggregating the output from each component. Each component provides a directional signal that is combined to form a unified trend reading. The trend value is then converted into a long (1), short (-1), or neutral (0) state.


Backtesting Mode and Performance Metrics
  • The Backtesting Mode includes a performance metrics table that compares the Buy and Hold strategy with the TrigWave Suite strategy. Key statistics like Sharpe Ratio, Sortino Ratio, and Omega Ratio are displayed to help users assess performance. Note that due to labels and plotchar use, automatic scaling may not function ideally in backtest mode.


Alerts and Visualization
  • Trend Direction Alerts: Set up alerts for long and short signals
  • Color Bars and Gradient Option: Bars are colored based on the trend direction, with an optional gradient for smoother visual feedback.


Important Notes
  • Customization: Default settings are experimental and not intended for trading/investing purposes. Users are encouraged to adjust and calibrate the settings to optimize results according to their trading style.
  • Backtest Results Disclaimer: Please note that backtest results are not indicative of future performance, and no strategy guarantees success.
Moving AveragesstatisticsTrend Analysis

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

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

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

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