[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

here we go again adx



PureBytes Links

Trading Reference Links

using System;
using System.Reflection; 
using System.Windows.Forms; 
using System.Diagnostics; 
using System.Drawing; 
using Tradevec.Base.Data; 
using System.ComponentModel; 
using Tradevec.Base; 
 
[assembly: AssemblyKeyName("")] 
 
[Description("This Indicator plots the ADX (Average Directional Movement Index)")] 
public class ADX : Indicator 
{ 
    #region Output parameters. Don't include in this region any code except output parameters 
     [Output("ADX", Style_Line, Region_NewOne, KnownColor.Red)] public double Plot1; 
     #endregion Output parameters 
 
    public void Main 
    ( 
          [Description("")] BarSeries serie, 
          [Description("Length"), DefaultValue(14)] Int32 Length, 
          [Description("ADX has just turned down"), DefaultValue(false)] Boolean ADXTurnedDownAlert, 
          [Description("ADX has just turned up"), DefaultValue(false)] Boolean ADXTurnedUpAlert 
 
     ) 
    { 
        Plot1 = f.ADX(serie, Length); 
        Plots.Add(Plot1); 
         
        if (serie.Count >= Length + 1) 
            if (ADXTurnedDownAlert && (Functions.MRO(Plots, Plots, 1, 2, 3, 1, -2) > -1 && Plot1 < Plots[1])) 
                Alert("ADX has just turned down"); 
            else 
            if (ADXTurnedUpAlert && (Functions.MRO(Plots, Plots, 1, 2, 3, 1, 2) > -1 && Plot1 > Plots[1])) 
                Alert("ADX has just turned up"); 
             
    } 
 
    private Functions f = new Functions(); 
    private SimpleNumericSeries Plots = new SimpleNumericSeries(); 
 
}