java.lang.Object
trade.invision.indicators.indicators.Indicator<Num>
trade.invision.indicators.indicators.statistical.Variance

public class Variance extends Indicator<Num>
Variance is a Num Indicator to provide the statistical variance (var) over a length of values.
See Also:
  • Constructor Details

    • Variance

      protected Variance(Indicator<Num> indicator, int length, boolean unbiased)
  • Method Details

    • var

      public static Variance var(Indicator<Num> indicator, int length, boolean unbiased)
      See Also:
    • variance

      public static Variance variance(Indicator<Num> indicator, int length, boolean unbiased)
      Gets a Variance.
      Parameters:
      indicator - the Indicator
      length - the number of values to look back at
      unbiased - true to use n - 1 (unbiased) for the divisor in the variance calculation, false to use n (biased)
    • calculate

      protected Num calculate(long index)
      Description copied from class: Indicator
      Performs the calculation of this Indicator at the given index.
      Specified by:
      calculate in class Indicator<Num>
      Parameters:
      index - the index
      Returns:
      the result (never null)