Selecting different EMA's can be accomplished using IDataSeries as in the attached Example. Is there a way this can be done with DrawArrowUp,DrawDot, etc???
// Example
public class MyCustomIndicator : Indicator
{
#region Variables
private int myMAperiod = 10; // Default setting for MyInput0
private IDataSeries myMA;
private myMAType myMovAvg = myMAType.EMA;
public enum myMAType { EMA,SMA,WMA,VWMA };
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
Overlay = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
///
///
protected override void OnStartUp()
{
switch (MyMovAvg)
{
case myMAType.EMA:
myMA = (EMA(Input, MyMAperiod));
break;
case myMAType.SMA:
myMA = (SMA(Input, MyMAperiod));
break;
case myMAType.WMA:
myMA = (WMA(Input, MyMAperiod));
break;
case myMAType.VWMA:
myMA = (VWMA(Input, MyMAperiod));
break;
}
}
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(myMA[0]);
}
Comment