OPEN-SOURCE SCRIPT

Hyperbolic Tangent SuperTrend [InvestorUnknown]

已更新
The Hyperbolic Tangent SuperTrend (HTST) is designed for technical analysis, particularly in markets with assets that have lower prices or price ratios. This indicator leverages the Hyperbolic Tangent Moving Average (HTMA), a custom moving average calculated using the hyperbolic tangent function, to smooth price data and reduce the impact of short-term volatility.

Hyperbolic Tangent Moving Average (HTMA):
  • The indicator's core uses a hyperbolic tangent function to calculate a smoothed average of the price. The HTMA provides enhanced trend-following capabilities by dampening the impact of sharp price swings and maintaining a focus on long-term market movements.
  • The hyperbolic tangent function (tanh) is commonly used in mathematical fields like calculus, machine learning and signal processing due to its properties of “squashing” inputs into a range between -1 and 1. The function provides a non-linear transformation that can reduce the impact of extreme values while retaining a certain level of smoothness.


快照



The HTMA is calculated by taking the difference between the price and its simple moving average (SMA), applying a multiplier to control sensitivity, and then transforming it using the hyperbolic tangent function.



Important Note: The Hyperbolic Tangent function becomes less accurate with very high prices. For assets priced above 100,000, the results may deteriorate, and for prices exceeding 1 million, the function may stop functioning properly. Therefore, this indicator is better suited for assets with lower prices or lower price ratios.

SuperTrend Calculation:
  • In addition to the HTMA, the indicator includes an Average True Range (ATR)-based SuperTrend calculation, which helps identify uptrends and downtrends in the market. The SuperTrend is adjusted dynamically using the HTMA to avoid false signals in fast-moving markets.
  • The ATR period and multiplier are customizable, allowing users to fine-tune the sensitivity of the trend signals.





Inbuilt Backtest Mode:
  • The HTST includes an inbuilt backtest mode that enables users to test the indicator's performance against historical data, similar to TradingView strategies.


快照

  • The backtest mode allows you to compare the performance of different indicator settings with a simple buy and hold strategy to assess its effectiveness in different market conditions.


快照

Hint Table for Display Modes:
  • The indicator includes a Hint Table that recommends the best pane to use for different display modes. For example, it suggests using the "Overlay" mode in the same pane as the price action, while the "Backtest Mode" is better suited for a separate pane. This ensures a more organized and clear visual experience.
  • The Hint Table appears as a small table at the bottom of the chart with easy-to-follow recommendations, ensuring the best setup for both visual clarity and indicator functionality.


With these features, the Hyperbolic Tangent SuperTrend Indicator offers traders a versatile and customizable tool for analyzing price trends while providing additional functionalities like backtesting and display mode hints for optimal usability.
發行說明
Updated the code to pinescript v6, added backtesting library v2 with more backtesting functions and removed old backtesting functions from the code
發行說明
Updated the code to pinescript v6, added backtesting library v2 with more backtesting functions and removed old backtesting functions from the code
Moving AveragesTrend Analysis

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明