HODL LINE [AstrideUnicorn]

This indicator determines periods of bull market when a buy-and-hold investor can hold the asset, and bear market periods when they should avoid holding it. Though it was designed primarily with cryptocurrencies in mind, it can be successfully used for any market.
Technically, the indicator is an asymmetric trend filter aimed to account for the fact that market sell-offs tend to be sharper than up-trends. The algorithm has two regimes – with and without price smoothing.

The step-like line is the main trend filter. It is colored green in an uptrend and red in a downtrend. When the smoothing is on, in addition to the trend filter, the indicator plots a purple line. It is a Hull Moving Average (HMA) of the price. In this case, the indicator uses this line instead of the price to find crossings with the trend filter.
When the price or the smoothed line crosses the trend filter above, it is an uptrend signal. The indicator marks such crossings with green circles. It also colors the chart background green in an uptrend. The price or the purple line crossing the trend filter below means a downtrend signal. Downtrend signals show as red circles. The chart background in a downtrend turns red.

Sensitivity – a dropdown list that allows the user to choose an averaging period of the indicator. Users can select a value for sensitivity from a predetermined set that better suits their investment horizon.
Use Smoothing – turns on and off smoothing of the price with HMA. With the smoothing turned on, the indicator responds slower to price changes, but at the same time produces less amount of false signals.

Our premium trading indicators:

Join our Discord community:

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。