public static DataSeries PlotPeakDivergence(this WealthScript obj, int proximity, ChartPane cp1, DataSeries ds1, double rev1, ChartPane cp2, DataSeries ds2, double rev2) public static DataSeries PlotTroughDivergence(this WealthScript obj, int proximity, ChartPane cp1, DataSeries ds1, double rev1, ChartPane cp2, DataSeries ds2, double rev2)public DataSeries PlotPeakDivergence(int proximity, ChartPane cp1, DataSeries ds1, double rev1, ChartPane cp2, DataSeries ds2, double rev2) public DataSeries PlotTroughDivergence(int proximity, ChartPane cp1, DataSeries ds1, double rev1, ChartPane cp2, DataSeries ds2, double rev2)
public PeakDivergence(int proximity, DataSeries ds, double pctRev1, DataSeries ds2, double pctRev2, string description) public TroughDivergence(int proximity, DataSeries ds, double pctRev1, DataSeries ds2, double pctRev2, string description)
/* Show Peak (Trough) divergence between High (Low) and RSI */ using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class DivergencePlotterExample : WealthScript { private StrategyParameter period; public DivergencePlotterExample() { period = CreateParameter("RSI Period",14,2,200,20); } protected override void Execute() { ChartPane rsiPane = CreatePane(40,true,true); ChartPane divPane = CreatePane(40,true,true); DataSeries rsi = RSI.Series(Close,period.ValueInt); PlotSeriesOscillator(rsiPane,rsi,70,30,Color.FromArgb(63,0,0,255),Color.FromArgb(63,255,0,0),Color.FromArgb(255,0,0,128),LineStyle.Solid,2); DataSeries pd = this.PlotPeakDivergence(6, PricePane, High, 10d, rsiPane, rsi, 15d); PlotSeries(divPane, pd, Color.Blue, LineStyle.Solid, 2); DataSeries td = this.PlotTroughDivergence(6, PricePane, Low, 10d, rsiPane, rsi, 15d); PlotSeries(divPane, td, Color.Red, LineStyle.Solid, 2); } } }
/* Show Peak (Trough) divergence between High (Low) and RSI */ using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Components; /*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/namespace WealthLab.Strategies { public class DivergencePlotterExample : WealthScript { private StrategyParameter period; public DivergencePlotterExample() { period = CreateParameter("RSI Period",14,2,200,20); } protected override void Execute() { ChartPane rsiPane = CreatePane(40,true,true); ChartPane divPane = CreatePane(40,true,true); DataSeries rsi = RSI.Series(Close,period.ValueInt); PlotSeriesOscillator(rsiPane,rsi,70,30,Color.FromArgb(63,0,0,255),Color.FromArgb(63,255,0,0),Color.FromArgb(255,0,0,128),LineStyle.Solid,2); SeriesHelper sh = new SeriesHelper(this); DataSeries pd = sh.PlotPeakDivergence(6, PricePane, High, 10d, rsiPane, rsi, 15d); PlotSeries(divPane, pd, Color.Blue, LineStyle.Solid, 2); DataSeries td = sh.PlotTroughDivergence(6, PricePane, Low, 10d, rsiPane, rsi, 15d); PlotSeries(divPane, td, Color.Red, LineStyle.Solid, 2); } } }