public class MyCustomIndicator : Indicator
{
#region Variables
#endregion
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Bar, "Plot0"));
CalculateOnBarClose = true;
Overlay = false;
}
protected override void OnBarUpdate()
{
if(Open[0] - Low[0] >= (0.75))
{
Plot0.Set(1.0); // sets value to #1 if true
}
else Plot0.Set(0.0);
}
#region Properties
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Plot0
{
get { return Values[0]; }
}
#endregion
}
Comment