public HTDCPhase(DataSeries ds, string description) public static HTDCPhase(DataSeries ds)
Compute the Hilbert Transform {Detrend Price} {Compute InPhase and Quadrature components} Compute the Period of the Dominant Cycle {Use ArcTangent to compute the current phase} {Resolve the ArcTangent ambiguity} {Compute a differential phase, resolve phase wraparound, and limit delta phase errors} {Sum DeltaPhases to reach 360 degrees. The sum is the instantaneous period.} {Resolve Instantaneous Period errors and smooth} Compute Dominant Cycle Phase Return the Dominant Cycle Phase at the current bar of the Hilbert Transform Period measured at that bar
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Example - Plot the phase of the Dominant Cycle HTDCPhase htdc = HTDCPhase.Series( AveragePrice.Series( Bars ) ); ChartPane PhasePane = CreatePane( 50, true, true ); PlotSeries( PhasePane, htdc, Color.Blue, LineStyle.Solid, 1 ); } } }