Ejemplo n.º 1
0
 public static double Value(TimeSeries input, int index, int length1, int length2, BarData option)
 {
     if (index >= input.FirstIndex)
     {
         return(EMA.Value(input, index, length1, option) - EMA.Value(input, index, length2, option));
     }
     else
     {
         return(double.NaN);
     }
 }
Ejemplo n.º 2
0
 public static double Value(TimeSeries input, int index, int length, BarData option)
 {
     if (index >= input.FirstIndex + 1)
     {
         double num1 = 2.0 / (double)(length + 1);
         double num2 = EMA.Value(input, index - 1, length, option);
         return(num2 + num1 * (input[index, option] - num2));
     }
     else if (index == input.FirstIndex)
     {
         return(input[input.FirstIndex, option]);
     }
     else
     {
         return(double.NaN);
     }
 }
Ejemplo n.º 3
0
 public static double Value(DoubleSeries input, int index, int length)
 {
     return(EMA.Value((TimeSeries)input, index, length, BarData.Close));
 }