public PivotPointBar(Bars bars, int period, bool pivotPointHigh, bool tradeable, string description) public static PivotPointBar Series(Bars bars, int period, bool pivotPointHigh, bool tradeable)
/* Demo to duplicate Non-tradeable Pivot Point annotations in AT Pro */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 PivotPointsDemo : WealthScript { private StrategyParameter _per; private StrategyParameter _tradeable; public PivotPointsDemo() { _per = CreateParameter("Pivot Period",5,2,21,2); _tradeable = CreateParameter("Tradeable=1",0,0,1,1); } protected override void Execute() { Font font = new Font("Wingdings", 8, FontStyle.Bold); string upArrow = Convert.ToChar(0x00E9).ToString(); string dnArrow = Convert.ToChar(0x00EA).ToString(); int per = _per.ValueInt; // When tradeable = true, notice that the pivot point changes frequently bool tradeable = (_tradeable.ValueInt == 1); DataSeries ppH_bar = PivotPointBar.Series(Bars, per, true, tradeable); DataSeries ppL_bar = PivotPointBar.Series(Bars, per, false, tradeable); for(int bar = per; bar < Bars.Count; bar++) { if( ppH_bar[bar] != ppH_bar[bar - 1] ) { AnnotateBar(dnArrow, bar, true, Color.Red, Color.Transparent, font); } else if( ppL_bar[bar] != ppL_bar[bar - 1] ) { AnnotateBar(upArrow, bar, false, Color.Green, Color.Transparent, font); } } } } }