public class Supertrend extends RecursiveIndicator<Num>
Supertrend is a Num Indicator to provide the Supertrend over a length of Bars.
See Also:
  • Constructor Details

  • Method Details

    • supertrend

      public static Supertrend supertrend(BarSeries barSeries, int length, Num multiplier, MovingAverageSupplier movingAverageSupplier)
      Gets a Supertrend.
      Parameters:
      barSeries - the BarSeries
      length - the number of values to look back at (typically 10)
      multiplier - the multiplier (typically 3)
      movingAverageSupplier - the MovingAverageSupplier
    • 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)