public HTQuadrature(DataSeries ds, string description) public static HTQuadrature Series(DataSeries ds)
Compute the Hilbert Transform {Detrend Price} {Compute InPhase and Quadrature components} Return the Quadrature component at the current bar of the Hilbert Transform computed 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() { // Color bars based on relative positions of Quadrature and In-Phase HTInPhase hti = HTInPhase.Series( AveragePrice.Series( Bars ) ); HTQuadrature htq = HTQuadrature.Series( AveragePrice.Series( Bars ) ); ChartPane HTQuadPane = CreatePane( 50, true, true ); PlotSeries( HTQuadPane, hti, Color.DarkBlue, LineStyle.Solid, 2 ); PlotSeries( HTQuadPane, htq, Color.LightBlue, LineStyle.Solid, 2 ); for(int bar = 0; bar < Bars.Count; bar++) { if( htibar > htqbar ) SetBarColor( bar, Color.DarkBlue ); else if( htibar < htqbar ) SetBarColor( bar, Color.LightBlue ); } } } }