Update dependency org.ta4j:ta4j-core to v0.19 #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.18->0.19Release Notes
ta4j/ta4j (org.ta4j:ta4j-core)
v0.19Compare Source
Breaking
TradingStatementis now an interface: Converted to an interface implemented byBaseTradingStatement. This exposes the underlyingStrategyandTradingRecordfor advanced analysis workflows. Action required: Update any code that directly instantiatesTradingStatementto useBaseTradingStatementinstead.ProfitLossCriterion,ProfitCriterion,LossCriterion,AverageProfitCriterion,AverageLossCriterion,ReturnCriterion,ProfitLossRatioCriterion, andProfitLossPercentageCriterioninto separate net and gross concrete classes. This provides explicit control over whether trading costs are included in calculations. Action required: Update imports and class names to use the appropriate net or gross variant based on your analysis needs.BinaryOperation,UnaryOperation,TransformIndicator, andCombineIndicatorinto a cleaner API. Action required: Replace deprecatedTransformIndicatorandCombineIndicatorusage with the new consolidated classes.MaximumDrawdownCriterionandReturnOverMaxDrawdownCriterionto thecriteria/drawdown/sub-package for better organization. Action required: Update import statements to reflect the new package location.Added
Rule#getName()andRule#setName(String)methods to allow rules to have custom names for improved trace logging and serialization. Rules now default to JSON-formatted names that include type and component information, but can be overridden with custom labels for better readability in logs and debugging output.HourOfDayRuleandMinuteOfHourRuleto enable trading strategies based on specific hours of the day (0-23) or minutes of the hour (0-59). These rules work withDateTimeIndicatorto filter trading signals by time, enabling time-of-day based strategies.HourOfDayStrategyandMinuteOfHourStrategyas example implementations demonstrating how to use the new time-based rules in complete trading strategies.BacktestExecutionResultandBacktestRuntimeReportwith newBacktestExecutorentry points. Users can now track per-strategy execution times, receive progress callbacks during long-running backtests, and efficiently stream top-k strategy selection for large strategy grids without loading all results into memory.StrategySerializationwithStrategy#toJson()andStrategy#fromJson(BarSeries, String)methods. This enables users to save and restore complete strategy configurations (including entry/exit rules) as JSON, making it easy to share strategies, version control configurations, and build strategy libraries.NamedStrategyserialization/deserialization with compact labels (e.g.,ToggleNamedStrategy_true_false_u3). Users can now persist strategy presets alongside their parameters in a human-readable format. Added registry/permutation helper APIs and lazy package scanning viaNamedStrategy.initializeRegistry(...)for efficient strategy discovery.RenkoUpIndicator,RenkoDownIndicator, andRenkoXIndicatorto detect Renko brick sequences, enabling users to build strategies based on Renko chart patterns.CumulativePnL,MaximumAbsoluteDrawdownCriterion,MaximumDrawdownBarLengthCriterion, andMonteCarloMaximumDrawdownCriterion. Users can now analyze drawdowns in absolute terms, measure drawdown duration, and estimate drawdown risk distributions through Monte Carlo simulation of different trade orderings.CommissionsCriterionto total commissions paid across positions andCommissionsImpactPercentageCriterionto measure how much trading costs reduce gross profit. This helps users understand the real impact of transaction costs on strategy performance.MaxConsecutiveLossCriterion,MaxConsecutiveProfitCriterion,MaxPositionNetLossCriterion, andMaxPositionNetProfitCriterion. Users can now identify worst loss streaks, best win streaks, and extreme per-position outcomes to better understand strategy risk and consistency.InPositionPercentageCriterionto calculate the percentage of time a strategy remains invested, helping users understand capital utilization and exposure.AmountBarBuilderto aggregate bars after a fixed number of amount have been traded. Bars can now be built bybeginTimeinstead ofendTime, providing more flexibility in bar aggregation strategies.MACDVIndicatorto volume-weight MACD calculations, providing an alternative MACD variant that incorporates volume information.NetMomentumIndicatorfor momentum-based strategy development.VoteRuleclass, enabling users to create rules that trigger based on majority voting from multiple underlying rules.AdaptiveJsonBarsSerializerto support OHLC bar data from Coinbase or Binance, and newJsonBarsSerializer.loadSeries(InputStream)overload for easier data loading from streams.NetMomentumStrategyandTopStrategiesExample, and bundled a Coinbase ETH/USD sample data set to demonstrate the new APIs.prepare-release.shto prepare release versions, creates release branches and tags, and publishes to Maven Central. Addedscripts/tests/test_prepare_release.shto validate release preparation functionality.DurationTypeAdapter,BasePerformanceReport, and revisedTradingStatementGeneratorso generated statements always carry their source strategy and trading record for complete traceability.substitutehelper function toUnaryOperationfor easier indicator transformations.DoubleNumFactoryandDecimalNumFactory, unit tests around indicator concurrency in preparation for future multithreading features, andDecimalNumPrecisionPerformanceTestto demonstrate precision vs performance trade-offs.Changed
RuleSerializationto preserve custom rule names set viasetName()during serialization and deserialization. Custom names are now properly distinguished from default JSON-formatted names, enabling better strategy persistence and debugging workflows.AbstractRuleandBaseStrategyto use rule names (custom or default) in log output, making it easier to identify which rules are being evaluated during strategy execution.log4j-slf4j2-implso examples and tests share a single logging backend. Added Log4j 2 configurations for modules and tests. This simplifies logging configuration and ensures consistent behavior across all modules. Set unit test logging level to INFO and cleaned build output of all extraneous logging.AverageReturnPerBarCriterion,EnterAndHoldCriterion, andReturnOverMaxDrawdownCriterionto useNetReturnCriterioninstead ofGrossReturnCriterionto avoid optimistic bias. This provides more realistic performance metrics that account for trading costs.ReturnOverMaxDrawdownCriterionnow returns 0 instead ofNaNfor strategies that never operate, and returns net profit instead ofNaNfor strategies with no drawdown. This makes the criterion more robust and easier to use in automated analysis.StopGainRuleandStopLossRulenow accept any priceIndicatorinstead of onlyClosePriceIndicator. Users can now create stop rules based on high, low, open, or custom price indicators for more sophisticated exit strategies.RecentSwingHighIndicatorandRecentSwingLowIndicatorwith plateau-aware, NaN-safe logic and exposedgetLatestSwingIndexfor downstream analysis. This improves reliability and enables more advanced swing-based strategies.DecimalNumprecision from 32 to 16 digits, improving performance while still maintaining sufficient accuracy for most use cases. Users can configure precision based on their specific needs.NumericIndicator'spreviousmethod now returns aNumericIndicator, enabling fluent method chaining for indicator composition.TradingRecordproperty toTradingStatementfor more downstream flexibility around analytics, enabling users to access the full trading record from performance reports.UpTrendIndicatorandDownTrendIndicator, making the code more maintainable and self-documenting.BaseBarSeriesBuildernow automatically uses theNumFactoryfrom given bars instead of the default one, ensuring consistent numeric types throughout bar series construction.Fixed
KalmanFilterIndicatoragainst NaN/Infinity measurements to keep the Kalman state consistent, preventing calculation errors when input data contains invalid values.RecursiveCachedIndicatorthat could lead to stack overflow in certain situations, improving reliability for complex indicator calculations.EnterAndHoldCriterionto properly keep track of transaction and hold costs, ensuring accurate performance comparisons.ConvergenceDivergenceIndicatorfor more accurate divergence detection.ReturnOverMaxDrawdownCriterionandVersusEnterAndHoldCriterionto ensure accurate performance metrics.ProfitLossPercentageCriterionto correctly calculate aggregated return, fixing previous calculation errors.BaseBarSeries#addTrade(final Number tradeVolume, final Number tradePrice)to match the method signature order.VolumeBarBuilderandTickBarBuilderto ensure accurate bar construction.PivotPointIndicatorTestto work with Java 25, ensuring compatibility with the latest Java versions. Note that this does not mean Ta4j as a whole now supports Java 25, that will come in a future release.MovingAverageCrossOverRangeBacktestthat prevented successfully loading test JSON bar data.Removed/Deprecated
TransformIndicatorandCombineIndicatorin favor of the consolidatedBinaryOperationIndicatorandUnaryOperationIndicatorclasses. Action required: Migrate any code using these deprecated classes to the new consolidated API.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.