Class TechnicalFilters

java.lang.Object
com.quantfinlib.screener.TechnicalFilters

public final class TechnicalFilters extends Object
Technical screening filters evaluated on the most recent bar. All filters are NaN-safe and return false when the series is too short.

Design contract worth stating: a screen answers "does this stock look like X TODAY", so every filter reads only the LAST valid indicator value — never a history of signals (that is a backtest's job, over in backtest). "Too short = false" rather than "too short = throw" is deliberate: a screen runs across an entire universe, and one recently-listed ticker with 30 bars must silently drop out of an SMA(200) screen, not kill the run for the other 2,999 names. The cost of that choice is that rsiBelow(14, 70) and "not enough data" are indistinguishable in the output — compose an explicit length/liquidity pre-filter first when the distinction matters. Filters compose via ScreenFilter.and(com.quantfinlib.screener.ScreenFilter)/or/negate; feed survivors to RankingEngine to order them.

  • Method Details

    • rsiBelow

      public static ScreenFilter rsiBelow(int period, double value)
    • rsiAbove

      public static ScreenFilter rsiAbove(int period, double value)
    • priceAboveSma

      public static ScreenFilter priceAboveSma(int period)
    • priceBelowSma

      public static ScreenFilter priceBelowSma(int period)
    • priceAboveEma

      public static ScreenFilter priceAboveEma(int period)
    • macdBullish

      public static ScreenFilter macdBullish()
      MACD line above its signal line on the last bar.
    • adxAbove

      public static ScreenFilter adxAbove(int period, double value)
    • atrPercentBelow

      public static ScreenFilter atrPercentBelow(int period, double maxFraction)
      ATR as a fraction of price below the threshold (low-volatility screen).
    • priceAboveVwap

      public static ScreenFilter priceAboveVwap()
    • superTrendBullish

      public static ScreenFilter superTrendBullish(int period, double multiplier)
    • bollingerBreakout

      public static ScreenFilter bollingerBreakout(int period, double k)
      Close above the upper Bollinger band (volatility breakout).
    • aboveIchimokuCloud

      public static ScreenFilter aboveIchimokuCloud()
      Close above both Ichimoku cloud spans on the last bar.
    • breakout

      public static ScreenFilter breakout(int lookback)
      Close breaks above the highest high of the previous lookback bars.
    • volumeSpike

      public static ScreenFilter volumeSpike(int lookback, double multiplier)
      Last bar volume exceeds multiplier times the prior average volume.
    • gapUp

      public static ScreenFilter gapUp(double minFraction)
      Gap up at the last open of at least minFraction versus the prior close.
    • near52WeekHigh

      public static ScreenFilter near52WeekHigh(double withinFraction)
      Close within withinFraction of the 52-week (252-bar) high.
    • near52WeekLow

      public static ScreenFilter near52WeekLow(double withinFraction)
      Close within withinFraction of the 52-week (252-bar) low.