Uses of Class
com.quantfinlib.core.BarSeries
Packages that use BarSeries
Package
Description
Cross-sectional alpha research: signal generation, evaluation,
validation, execution-aware backtesting, portfolio construction and
reporting, each a separate step.
Bar-based backtesting engines, execution models and performance analytics.
Multi-asset portfolio backtesting with point-in-time universes and
financing.
Validation tools that test a backtest for overfitting.
Core bar and bar-series types used by every analytics package.
Loading, recording, replaying and aligning market data.
Technical indicators in batch and streaming form.
Market microstructure analytics: impact, liquidity, order-flow signals
and intraday curves.
Stock screening by technical and fundamental filters, with ranking and
CSV export.
Volatility models: EWMA, GARCH-family, HAR-RV, a model-free volatility
index and a systematic/idiosyncratic decomposition.
-
Uses of BarSeries in com.quantfinlib.alpha
Methods in com.quantfinlib.alpha that return BarSeriesModifier and TypeMethodDescriptionAlphaContext.series(int i) Price series for symbol indexi(the panel axis, not the bar).Methods in com.quantfinlib.alpha with parameters of type BarSeriesModifier and TypeMethodDescriptionstatic double[]PortfolioConstruction.trailingBetas(AlphaContext ctx, int index, int lookback, BarSeries market) Trailing OLS betas against an external market series aligned with the panel (same bar count and timestamps), for example an index.Method parameters in com.quantfinlib.alpha with type arguments of type BarSeriesModifier and TypeMethodDescriptionstatic AlphaContextPanel without fundamentals (technical factors only).static AlphaContextPanel with a static fundamentals snapshot. -
Uses of BarSeries in com.quantfinlib.backtest
Methods in com.quantfinlib.backtest with parameters of type BarSeriesModifier and TypeMethodDescriptiondoubleAll-in one-way cost, in bps of traded notional, for tradingnotional(currency units, always positive) ofseriesat barindex.Executes up torequestedQtyon this bar.voiddefault doubleExecutionModel.referencePrice(BarSeries series, int index) The price this model's fills are anchored to on the given bar — the engine budgets entry requests ascash / (referencePrice * (1 + worstCaseCostFraction())).doubleIcebergExecution.referencePrice(BarSeries series, int index) doubleLastLookExecution.referencePrice(BarSeries series, int index) static BacktestResultBacktester.run(TradingStrategy strategy, BarSeries series, BacktestConfig config) static BacktestResultBacktester.run(TradingStrategy strategy, BarSeries series, BacktestConfig config, int tradeFrom) Variant with a warm-up prefix: indicators are initialised over the whole series, but no signal is acted on (and no equity recorded) beforetradeFrom.ExecutionAlgoBacktester.run(BarSeries series, Side side, long parentQty, BenchmarkExecutor.Benchmark benchmark) ExecutionAlgoBacktester.run(BarSeries, Side, long, BenchmarkExecutor.Benchmark, double)for the time/volume benchmarks (no POV rate needed).ExecutionAlgoBacktester.run(BarSeries series, Side side, long parentQty, BenchmarkExecutor.Benchmark benchmark, double povRate) WorksparentQtythrough the session underbenchmarkand grades it.static ExecutionAwareResultExecutionAwareBacktester.run(TradingStrategy strategy, BarSeries series, BacktestConfig config, ExecutionModel model) static Backtester.SegmentBacktester.runSegment(TradingStrategy strategy, BarSeries series, BacktestConfig config, int tradeFrom, Backtester.State start, int indexOffset, boolean liquidateAtEnd) Runs bars[tradeFrom, n)ofseriesstarting fromstart.static BacktestResultBacktester.runWholeLots(TradingStrategy strategy, BarSeries series, BacktestConfig config, double lotSize) AsBacktester.run(TradingStrategy, BarSeries, BacktestConfig)but entries buy a whole number of lots instead of investing all cash. -
Uses of BarSeries in com.quantfinlib.backtest.portfolio
Method parameters in com.quantfinlib.backtest.portfolio with type arguments of type BarSeriesModifier and TypeMethodDescriptionvoidvoiddefault voidPrice-pair initialisation used by the survivorship-aware engine:signalDatais split and dividend adjusted and is what signals must be computed on;tradeDatais the unadjusted series the engine trades on, available for strategies that need actual prices (share-count limits, price filters).static PortfolioBacktester.ResultPortfolioBacktester.run(PortfolioStrategy strategy, Map<String, BarSeries> data, PortfolioBacktester.Config config) Classic run: every supplied symbol is tradeable on every bar.static PortfolioBacktester.ResultPortfolioBacktester.run(PortfolioStrategy strategy, Map<String, BarSeries> data, PortfolioBacktester.Config config, PointInTimeUniverse universe, Map<String, List<CorporateActions.CorporateAction>> cashDividends) Survivorship-aware run (see the class doc for semantics).static PortfolioBacktester.ResultPortfolioBacktester.run(PortfolioStrategy strategy, Map<String, BarSeries> data, Map<String, BarSeries> signalData, PortfolioBacktester.Config config, PointInTimeUniverse universe, Map<String, List<CorporateActions.CorporateAction>> cashDividends) Survivorship-aware run on a price pair:signalData(split and dividend adjusted, for example viaCorporateActions.adjust(BarSeries, List)) is what the strategy sees for its signals;data(unadjusted) is what the engine trades, values and pays dividends on.static PortfolioBacktester.ResultPortfolioBacktester.run(PortfolioStrategy strategy, Map<String, BarSeries> data, Map<String, BarSeries> signalData, PortfolioBacktester.Config config, PointInTimeUniverse universe, Map<String, List<CorporateActions.CorporateAction>> cashDividends, PortfolioBacktester.Participation participation) The price-pair run with a participation cap (null= none).static PortfolioBacktester.ResultPortfolioBacktester.run(PortfolioStrategy strategy, Map<String, BarSeries> data, Map<String, BarSeries> signalData, PortfolioBacktester.Config config, PointInTimeUniverse universe, Map<String, List<CorporateActions.CorporateAction>> cashDividends, PortfolioBacktester.Participation participation, Map<String, List<CorporateEvents.Event>> corporateEvents) The participation-capped run plus extendedCorporateEvents, booked on the position book on their ex-date (after the 2.1 cash dividends, before terminal events). -
Uses of BarSeries in com.quantfinlib.backtest.validation
Methods in com.quantfinlib.backtest.validation with parameters of type BarSeriesModifier and TypeMethodDescriptionWalkForwardAnalyzer.analyze(BarSeries series, ParameterGrid grid, StrategyFactory factory, BacktestConfig config, int trainBars, int testBars, ToDoubleFunction<PerformanceMetrics> objective) Runs a walk-forward optimisation over the parameter grid.GridSearchOptimizer.best(ParameterGrid grid, StrategyFactory factory, BarSeries series, BacktestConfig config, ToDoubleFunction<PerformanceMetrics> objective) The winning parameter set only.static List<GridSearchOptimizer.Candidate> GridSearchOptimizer.search(ParameterGrid grid, StrategyFactory factory, BarSeries series, BacktestConfig config, ToDoubleFunction<PerformanceMetrics> objective) -
Uses of BarSeries in com.quantfinlib.core
Methods in com.quantfinlib.core that return BarSeries -
Uses of BarSeries in com.quantfinlib.data
Methods in com.quantfinlib.data that return BarSeriesModifier and TypeMethodDescriptionstatic BarSeriesCorporateActions.adjust(BarSeries series, List<CorporateActions.CorporateAction> actions) Returns a new back-adjusted series; the input is untouched.static BarSeriesCorporateEvents.adjust(BarSeries series, List<? extends CorporateEvents.Event> events) Back-adjusts withCorporateEvents.DividendPolicy.ALL.static BarSeriesCorporateEvents.adjust(BarSeries series, List<? extends CorporateEvents.Event> events, CorporateEvents.DividendPolicy policy) Returns a new back-adjusted series; the input is untouched.Methods in com.quantfinlib.data that return types with arguments of type BarSeriesModifier and TypeMethodDescriptionTimestamps common to all series, in order; input map order preserved.SeriesAligner.unionForwardFill(Map<String, BarSeries> input) Union of timestamps from the latest series start onward; missing bars are forward-filled as flat bars at the previous close with zero volume.Methods in com.quantfinlib.data with parameters of type BarSeriesModifier and TypeMethodDescriptionstatic BarSeriesCorporateActions.adjust(BarSeries series, List<CorporateActions.CorporateAction> actions) Returns a new back-adjusted series; the input is untouched.static BarSeriesCorporateEvents.adjust(BarSeries series, List<? extends CorporateEvents.Event> events) Back-adjusts withCorporateEvents.DividendPolicy.ALL.static BarSeriesCorporateEvents.adjust(BarSeries series, List<? extends CorporateEvents.Event> events, CorporateEvents.DividendPolicy policy) Returns a new back-adjusted series; the input is untouched.static doubleCorporateEvents.totalReturnError(BarSeries raw, BarSeries adjusted, List<? extends CorporateEvents.Event> events) Total-return consistency check.Method parameters in com.quantfinlib.data with type arguments of type BarSeriesModifier and TypeMethodDescriptionTimestamps common to all series, in order; input map order preserved.SeriesAligner.unionForwardFill(Map<String, BarSeries> input) Union of timestamps from the latest series start onward; missing bars are forward-filled as flat bars at the previous close with zero volume. -
Uses of BarSeries in com.quantfinlib.indicators
Methods in com.quantfinlib.indicators with parameters of type BarSeriesModifier and TypeMethodDescriptionstatic Indicators.AdxAverage Directional Index with +DI / -DI (Wilder).static double[]Average True Range (Wilder smoothing).static double[]Commodity Channel Index over typical price.static double[]Chaikin Money Flow.static Indicators.DonchianDonchian Channel: highest high / lowest low over the period.static Indicators.IchimokuIchimoku Cloud with standard forward/backward displacement: senkou spans are plottedkijunPeriodbars ahead, chikoukijunPeriodbars behind.static Indicators.KeltnerKeltner Channel: EMA middle band with ATR-based envelope.static double[]On-Balance Volume.static double[]Indicators.parabolicSar(BarSeries s, double afStart, double afStep, double afMax) Parabolic SAR (standard Wilder acceleration schedule).static Indicators.SuperTrendIndicators.superTrend(BarSeries s, int period, double multiplier) SuperTrend with ATR bands.static double[]True range series.static double[]Cumulative Volume-Weighted Average Price (anchored at the series start).static double[]Williams %R: -100 * (highestHigh - close) / (highestHigh - lowestLow). -
Uses of BarSeries in com.quantfinlib.microstructure
Methods in com.quantfinlib.microstructure with parameters of type BarSeriesModifier and TypeMethodDescriptionstatic MarketImpactModelEstimates a model for a trade decided at barindexfrom thewindowbars strictly before it: ADV is the mean volume and daily volatility the population standard deviation of close-to-close returns over bars[index - window, index - 1]. -
Uses of BarSeries in com.quantfinlib.screener
Methods in com.quantfinlib.screener that return BarSeriesModifier and TypeMethodDescriptionStockSnapshot.series()Returns the value of theseriesrecord component.Constructors in com.quantfinlib.screener with parameters of type BarSeriesModifierConstructorDescriptionStockSnapshot(String symbol, BarSeries series, Fundamentals fundamentals) Creates an instance of aStockSnapshotrecord class. -
Uses of BarSeries in com.quantfinlib.volatility
Methods in com.quantfinlib.volatility with parameters of type BarSeriesModifier and TypeMethodDescriptionstatic doubleRangeVolatility.garmanKlass(BarSeries bars, double periodsPerYear) Garman-Klass over a wholeBarSeries.static doubleParkinson over a wholeBarSeries.static doubleRangeVolatility.rogersSatchell(BarSeries bars, double periodsPerYear) Rogers-Satchell over a wholeBarSeries.static doubleYang-Zhang over a wholeBarSeries.