Hilbert Transform - Dominant Cycle Phase
HT_DCPHASE identifies the dominant cycle phase using Hilbert Transform.
Method
tm.ta.ht_dcphase(source)
Inputs
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source | pd.Series | Input data series | - |
Outputs
Output | Type |
---|---|
ht_dcphase | np.ndarray |
Example usage
import tradomate as tm
@tm.strategy()def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Hilbert Transform - Dominant Cycle Phase ht_dcphase = tm.ta.ht_dcphase(data.close)
# Get the last value and print last_value = ht_dcphase.iloc[-1] tm.log(f"Last value of Hilbert Transform - Dominant Cycle Phase is {last_value}")
# Plot the values of ht_dcphase tm.plot(ht_dcphase, title="Hilbert Transform - Dominant Cycle Phase", overlay=False)