Hilbert Transform - Dominant Cycle Period
HT_DCPERIOD identifies the dominant cycle period using Hilbert Transform.
Method
tm.ta.ht_dcperiod(source)
Inputs
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source | pd.Series | Input data series | - |
Outputs
Output | Type |
---|---|
ht_dcperiod | 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 Period ht_dcperiod = tm.ta.ht_dcperiod(data.close)
# Get the last value and print last_value = ht_dcperiod.iloc[-1] tm.log(f"Last value of Hilbert Transform - Dominant Cycle Period is {last_value}")
# Plot the values of ht_dcperiod tm.plot(ht_dcperiod, title="Hilbert Transform - Dominant Cycle Period", overlay=False)