Class TechnicalFilters
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 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 ScreenFilterstatic 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
-
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.
-