public FractalDown(DataSeries ds, string description) public static FractalDown Series(DataSeries ds)
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 ShowFractalDemo : WealthScript { public void ShowFractals(DataSeries fractalupbars, DataSeries fractaludnbars) { Font _wing = new Font("Wingdings", 11, FontStyle.Bold); string _upFractal = Convert.ToChar(0x00D9).ToString(); string _dnFractal = Convert.ToChar(0x00DA).ToString(); for(int n = 5; n < fractalupbars.Count; n++) { if (fractalupbars[n] > fractalupbars[n-1]) { int fbar = (int)fractalupbars[n]; AnnotateBar(_upFractal, fbar, true, Color.Silver, Color.Transparent, _wing); } if (fractaludnbars[n] > fractaludnbars[n-1]) { int fbar = (int)fractaludnbars[n]; AnnotateBar(_dnFractal, fbar, false, Color.Silver, Color.Transparent, _wing); } } } protected override void Execute() { /* Fractals */ DataSeries frUpBar = FractalUpBar.Series(High); DataSeries frDnBar = FractalDownBar.Series(Low); ShowFractals(frUpBar, frDnBar); DataSeries frUp = FractalUp.Series(High); DataSeries frDn = FractalDown.Series(Low); PlotSeries(PricePane, frUp, Color.Blue, LineStyle.Dots, 3); PlotSeries(PricePane, frDn, Color.Fuchsia, LineStyle.Dots, 3); } } }