Posts

Constant Lines Areas - makes vertical constant lines and color each area created by the lines

public class ConstantLineArea : Indicator     {         #region Variables          private double line0Value = 68.88; private double line1Value = 67.77; private double line2Value = 66.66; private double line3Value = 65.55;        #endregion         protected override void Initialize()         {             Add(new Plot(Color.DimGray, PlotStyle.Line, "Line0")); Add(new Plot(Color.DimGray, PlotStyle.Line, "Line1"));             Add(new Plot(Color.DimGray, PlotStyle.Line, "Line2"));             Add(new Plot(Color.DimGray, PlotStyle.Line, "Line3")); ChartOnly = true;             AutoScale = false; CalculateOnBarClose = true; DisplayInDataBox = false;             Overlay =...

Chart Sizing - adjusts the vertical scale of the chart by the number of ticks

public class ChartSizingSimple : Indicator     {         #region Variables         // Wizard generated variables             private int myInput0 = 40; // Default setting for MyInput0 private int myInput1 = 20; // Default setting for MyInput0         #endregion         protected override void Initialize()         {             Overlay = true;         }        protected override void OnBarUpdate()         { if (CurrentBar < 1)         return; else { ChartControl.YAxisRangeTypeRight = YAxisRangeType.Fixed; ChartControl.FixedPanelMaxRight = Close[0] + TickSize * myInput0 + TickSize * 2 + TickSize * myInput1; ChartControl.FixedPanelMinRight = Close[0] - TickSize * myInput0 - TickSi...

Chart Description Text - provides a description text box at the top left corner

 public class ChartDescriptionText : Indicator     {         #region Variables                     private string chartDesc = ""; private Font myFont = new Font("Arial", 20);                 #endregion         protected override void Initialize()         {             Overlay = true;         }        protected override void OnBarUpdate()         { if (CurrentBar < 1)         return; DrawTextFixed("tag1Flag", chartDesc, TextPosition.TopLeft, Color.White, myFont, Color.Transparent, Color.DimGray, 5); }         #region Properties               [Description("")]         [GridCategory("Paramet...

ATR in Tick - shows ATR in the number of ticks

public class ATRTick : Indicator { #region Variables private int period = 14; #endregion protected override void Initialize() { Add(new Plot(Color.Green, "ATRTick")); } protected override void OnBarUpdate() { if (CurrentBar == 0) Value.Set((High[0] - Low[0]) / TickSize); else { double trueRange = (High[0] - Low[0]) / TickSize; trueRange = Math.Max(Math.Abs((Low[0] - Close[1]) / TickSize), Math.Max(trueRange, Math.Abs((High[0] - Close[1]) / TickSize))); Value.Set((((Math.Min(CurrentBar + 1, Period) - 1 ) * Value[1] + trueRange) / Math.Min(CurrentBar + 1, Period)) ); } } #region Properties [Description("Numbers of bars used for calculations")] [GridCategory("Parameters")] public int Period { get { return period; } set { period = Math.Max(1, value); } } #endregion }

ADX Alert - Show a signs when ADX reaches a certain level

public class ADXAlert : Indicator     {         #region Variables            private int myInput0 = 5;            private int upperLevel = 65;            private int lowerLevel = 12;         #endregion        protected override void Initialize()         {             Add(new Plot(Color.FromKnownColor(KnownColor.Snow), PlotStyle.Line, "Plot0"));    Add(new Line(Color.HotPink, lowerLevel, "Lower"));    Add(new Line(Color.YellowGreen, upperLevel, "Upper"));             Overlay    = false;    DrawOnPricePanel = false;         }         protected override void OnBarUpdate()         {    if (CurrentBar &lt; 1)     ...