Exemple #1
0
		public SMA(TimeSeries input, int length, BarData option, Color color) : base(input)
		{
			this.fLength = length;
			this.fOption = option;
			this.Init();
			this.Color = color;
		}
Exemple #2
0
    public KRI(TimeSeries input, int length)
			: base(input)  {
      this.fLength = 14;

      this.fLength = length;
      this.Init();
    }
Exemple #3
0
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index < length - 1 + input.FirstIndex)
     return double.NaN;
   double min = input.GetMin(index - length + 1, index, BarData.Low);
   return Math.Log(input.GetMax(index - length + 1, index, BarData.High) / min);
 }
Exemple #4
0
		public PCL(TimeSeries input, int length, Color color)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.Init();
      this.Color = color;
    }
Exemple #5
0
		public PERF(TimeSeries input, double k, BarData option)	: base(input) 
    {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
    }
Exemple #6
0
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index >= length + input.FirstIndex)
     return input.GetMin(index - length, index - 1, BarData.Low);
   else
     return double.NaN;
 }
Exemple #7
0
		public Range(TimeSeries input, int length, Color color)	: base(input) 
    {
      this.length = 14;
      this.length = length;
      this.Init();
			this.fColor = color;
    }
Exemple #8
0
 public static double Value(TimeSeries input, int index)
 {
   if (index >= 1 + input.FirstIndex)
     return Math.Max(input[index, BarData.High], input[index - 1, BarData.Close]);
   else
     return double.NaN;
 }
Exemple #9
0
		public PDI(TimeSeries input, int length, EIndicatorStyle style)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fStyle = style;
      this.Init();
    }
Exemple #10
0
 public static double Value(TimeSeries input, int index)
 {
   if (index < 1 + input.FirstIndex)
     return double.NaN;
   double num1 = input[index, BarData.Close];
   double num2 = input[index - 1, BarData.Close];
   double num3 = input[index, BarData.Volume];
   double num4 = 0.0;
   if (index > 1 + input.FirstIndex)
   {
     if (num1 > num2)
       num4 = OBV.Value(input, index - 1) + num3;
     if (num1 < num2)
       num4 = OBV.Value(input, index - 1) - num3;
     if (num1 == num2)
       num4 = OBV.Value(input, index - 1);
   }
   else
   {
     if (num1 > num2)
       num4 = num3;
     if (num1 < num2)
       num4 = -num3;
     if (num1 == num2)
       num4 = 0.0;
   }
   return num4;
 }
Exemple #11
0
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index >= length - 1 + input.FirstIndex)
     return (input[index, BarData.Volume] - input[index - length + 1, BarData.Volume]) / input[index - length + 1, BarData.Volume] * 100.0;
   else
     return double.NaN;
 }
Exemple #12
0
		public EMA(TimeSeries input, int length, BarData option)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.Init();
    }
Exemple #13
0
		public PCL(TimeSeries input, int length, Color color, EDrawStyle drawStyle)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
Exemple #14
0
    public RSI(TimeSeries input, int length, BarData option, EIndicatorStyle style)
			: base(input){
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.fStyle = style;
      this.Init();
    }
Exemple #15
0
		public D_Fast(TimeSeries input, int length, int order)	: base(input) 
    {
      this.fLength = 14;
      this.fOrder = 10;
      this.fLength = length;
      this.fOrder = order;
      this.Init();
    }
Exemple #16
0
    public Range(TimeSeries input, int length, Color color, EDrawStyle drawStyle)
			: base(input)  {
      this.length = 14;
      this.length = length;
      this.Init();
			this.fColor = color;
      this.fDrawStyle = drawStyle;
    }
Exemple #17
0
		public ADXR(TimeSeries input, int length, EIndicatorStyle style, Color color)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fStyle = style;
      this.Init();
      this.Color = color;
    }
Exemple #18
0
		public PERF(TimeSeries input, double k, BarData option, Color color)	: base(input) 
    {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
      this.Color = color;
    }
Exemple #19
0
		public VCH(TimeSeries input, int length1, int length2):base(input)
    {
      this.fLength1 = 14;
      this.fLength2 = 10;
      this.fLength1 = length1;
      this.fLength2 = length2;
      this.Init();
    }
Exemple #20
0
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index < length - 1 + input.FirstIndex)
     return double.NaN;
   double num = input[index, BarData.Close];
   double min = input.GetMin(index - length + 1, index, BarData.Low);
   double max = input.GetMax(index - length + 1, index, BarData.High);
   return -100.0 * (max - num) / (max - min);
 }
Exemple #21
0
		public VCH(TimeSeries input, int length1, int length2, Color color): base(input)
    {
      this.fLength1 = 14;
      this.fLength2 = 10;
      this.fLength1 = length1;
      this.fLength2 = length2;
      this.Init();
      this.Color = color;
    }
Exemple #22
0
		public ENVL(TimeSeries input, int length, double shift, BarData option)	: base(input) 
    {
      this.fLength = 14;
      this.fShift = 20.0;
      this.fLength = length;
      this.fShift = shift;
      this.fOption = option;
      this.Init();
    }
Exemple #23
0
    public EMA(TimeSeries input, int length, BarData option, Color color, EDrawStyle drawStyle)
			: base(input) {
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
Exemple #24
0
 public static double Value(TimeSeries input, int index)
 {
   if (index < 1 + input.FirstIndex)
     return double.NaN;
   double num1 = input[index, BarData.Close];
   double num2 = input[index - 1, BarData.Close];
   double num3 = input[index, BarData.Volume];
   return index < 2 + input.FirstIndex ? (num1 - num2) / num2 * num3 : (num1 - num2) / num2 * num3 + PVT.Value(input, index - 1);
 }
Exemple #25
0
 public static double Value(TimeSeries input, int index)
 {
   if (index < input.FirstIndex + 1)
     return double.NaN;
   double num1 = input[index, BarData.High];
   double num2 = input[index, BarData.Low];
   double num3 = input[index - 1, BarData.Close];
   return Math.Max(Math.Abs(num1 - num2), Math.Max(Math.Abs(num1 - num3), Math.Abs(num3 - num2)));
 }
Exemple #26
0
    public PERF(TimeSeries input, double k, BarData option, Color color, EDrawStyle drawStyle)
			: base(input) {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
Exemple #27
0
    public PDI(TimeSeries input, int length, EIndicatorStyle style, Color color, EDrawStyle drawStyle)
			: base(input) {
      this.fLength = 14;
      this.fLength = length;
      this.fStyle = style;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
Exemple #28
0
 public static double Value(TimeSeries input, int index)
 {
   if (index < input.FirstIndex)
     return double.NaN;
   double num1 = input[index, BarData.High];
   double num2 = input[index, BarData.Low];
   double num3 = input[index, BarData.Volume];
   return num3 == 0.0 ? 0.0 : (num1 - num2) / num3 * 1000.0;
 }
Exemple #29
0
    public MACD(TimeSeries input, int length1, int length2, BarData option)
			: base(input)  {
      this.fLength1 = 14;
      this.fLength2 = 10;
      this.fLength1 = length1;
      this.fLength2 = length2;
      this.fOption = option;
      this.Init();
    }
Exemple #30
0
    public BBU(TimeSeries input, int length, double k, BarData option)
			: base(input)   {
      this.fLength = 14;
      this.fK = 3.0;
      this.fLength = length;
      this.fOption = option;
      this.fK = k;
      this.Init();
    }
Exemple #31
0
 ///<summary>
 ///  Initializes a new instance of the UserIndicator class
 ///</summary>
 public UserIndicator(ISeries input)
 {
     this.input = input;
     if (input is TimeSeries)
     {
         this.series = (FreeQuant.Series.TimeSeries)(input as TimeSeries).series;
     }
     if (input is BarSeries)
     {
         this.series = (FreeQuant.Series.TimeSeries)(input as BarSeries).series;
     }
     if (input is Indicator)
     {
         this.series = (FreeQuant.Series.TimeSeries)(input as Indicator).indicator;
     }
     this.indicator = new FreeQuant.Indicators.Indicator(this.series);
 }
Exemple #32
0
 public SeriesEventArgs(TimeSeries series) : base()
 {
     this.Series = series;
 }
Exemple #33
0
 public virtual double GetCovariance(TimeSeries series)
 {
     throw new NotSupportedException();
 }
Exemple #34
0
 public ECross Crosses(TimeSeries series, Bar bar, BarData barData)
 {
     return(this.Crosses(series, bar.DateTime, barData));
 }
Exemple #35
0
 public override double GetCovariance(TimeSeries series)
 {
     return(this.GetCovariance(series, this.FirstDateTime, this.LastDateTime));
 }
Exemple #36
0
 public bool CrossesAbove(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime) == ECross.Above);
 }
Exemple #37
0
 public bool CrossesAbove(TimeSeries series, DateTime dateTime)
 {
     return(this.Crosses(series, dateTime) == ECross.Above);
 }
Exemple #38
0
 public bool CrossesBelow(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime) == ECross.Below);
 }
Exemple #39
0
 public bool CrossesBelow(TimeSeries series, DateTime dateTime)
 {
     return(this.Crosses(series, dateTime) == ECross.Below);
 }
Exemple #40
0
 public ECross Crosses(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime));
 }
Exemple #41
0
 public ECross Crosses(TimeSeries series, DateTime dateTime, BarData barData)
 {
     return(this.Crosses(series, dateTime, (int)barData));
 }
Exemple #42
0
 public virtual double GetCorrelation(TimeSeries series, DateTime datetime1, DateTime datetime2)
 {
     throw new NotSupportedException();
 }
Exemple #43
0
 public virtual double GetCorrelation(TimeSeries series)
 {
     throw new NotSupportedException();
 }
Exemple #44
0
 public ECross Crosses(TimeSeries series, Bar bar, int row)
 {
     return(this.Crosses(series, bar.DateTime, row));
 }