Hilbert Transform - Phasor Components
HT_PHASOR calculates the sine and cosine components of the dominant cycle.
Method
Section titled “Method”tm.ta.ht_phasor(source)Inputs
Section titled “Inputs”| Parameter | Argument type | Description | Default Value |
|---|---|---|---|
| source | pd.Series | Input data series | - |
Outputs
Section titled “Outputs”| Output | Type |
|---|---|
| inphase | np.ndarray |
| quadrature | np.ndarray |
Example usage
Section titled “Example usage”import tradomate as tm
@tm.strategy()def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Hilbert Transform - Phasor Components inphase, quadrature = tm.ta.ht_phasor(data.close)
# Get the last value and print last_value = inphase.iloc[-1] tm.log(f"Last value of Hilbert Transform - Phasor Components is {last_value}")
# Plot the values of inphase tm.plot(inphase, title="Hilbert Transform - Phasor Components", overlay=False)