Class TechnicalFilters
java.lang.Object
com.quantfinlib.screener.TechnicalFilters
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: 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 intended: 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(ScreenFilter)/or/negate;
feed survivors to RankingEngine to order them.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScreenFilterClose above both Ichimoku cloud spans on the last bar.static ScreenFilteradxAbove(int period, double value) static ScreenFilteratrPercentBelow(int period, double maxFraction) ATR as a fraction of price below the threshold (low-volatility screen).static ScreenFilterbollingerBreakout(int period, double k) Close above the upper Bollinger band (volatility breakout).static ScreenFilterbreakout(int lookback) Close breaks above the highest high of the previouslookbackbars.static ScreenFiltergapUp(double minFraction) Gap up at the last open of at leastminFractionversus the prior close.static ScreenFilterMACD line above its signal line on the last bar.static ScreenFilternear52WeekHigh(double withinFraction) Close withinwithinFractionof the 52-week (252-bar) high.static ScreenFilternear52WeekLow(double withinFraction) Close withinwithinFractionof the 52-week (252-bar) low.static ScreenFilterpriceAboveEma(int period) static ScreenFilterpriceAboveSma(int period) static ScreenFilterpriceAboveVwap(int)over the last 20 bars.static ScreenFilterpriceAboveVwap(int window) Last close above the volume-weighted average typical price(H+L+C)/3of the lastwindowbars.static ScreenFilterpriceBelowSma(int period) static ScreenFilterrsiAbove(int period, double value) static ScreenFilterrsiBelow(int period, double value) static ScreenFiltersuperTrendBullish(int period, double multiplier) static ScreenFiltervolumeSpike(int lookback, double multiplier) Last bar volume exceedsmultipliertimes the prior average volume.
-
Method Details
-
rsiBelow
-
rsiAbove
-
priceAboveSma
-
priceBelowSma
-
priceAboveEma
-
macdBullish
MACD line above its signal line on the last bar. -
adxAbove
-
atrPercentBelow
ATR as a fraction of price below the threshold (low-volatility screen). -
priceAboveVwap
priceAboveVwap(int)over the last 20 bars. -
priceAboveVwap
Last close above the volume-weighted average typical price(H+L+C)/3of the lastwindowbars. A VWAP anchored at the first bar of a multi-year series is a meaningless level; a rolling window keeps it comparable with the current price. Falls back to the equal-weighted mean when the window has no volume. -
superTrendBullish
-
bollingerBreakout
Close above the upper Bollinger band (volatility breakout). -
aboveIchimokuCloud
Close above both Ichimoku cloud spans on the last bar. -
breakout
Close breaks above the highest high of the previouslookbackbars. -
volumeSpike
Last bar volume exceedsmultipliertimes the prior average volume. -
gapUp
Gap up at the last open of at leastminFractionversus the prior close. -
near52WeekHigh
Close withinwithinFractionof the 52-week (252-bar) high. -
near52WeekLow
Close withinwithinFractionof the 52-week (252-bar) low.
-