Pine Script port of J. Ehlers EasyLanguage code of Hilbert Transform Indicator from his book "Cycle Analytics for Traders". Accordingly to book, this indicator helps to predict turning points when market is in cycle mode. IOW, it signals rather to prepare to close position rather than open new position.