Ta4j Versions Save

A Java library for technical analysis.

0.15

1 year ago

Release 0.15 of the Ta4j library.

This is the second release via GitHub Releases. Ta4j is also available on the maven central repository

www.ta4j.org

Changelog for ta4j, roughly following keepachangelog.com from version 0.9 onwards.

0.15 (released September 11, 2022)

Breaking

  • NumberOfConsecutiveWinningPositions renamed to NumberOfConsecutivePositions
  • DifferencePercentage renamed to DifferencePercentageIndicator
  • BuyAndHoldCriterion renamed to EnterAndHoldCriterion
  • DXIndicator moved to adx-package
  • PlusDMIndicator moved to adx-package
  • MinusDMIndicator moved to adx-package
  • analysis/criterion-package moved to root
  • cost-package moved to analysis/cost-package
  • AroonXXX indicators moved to aroon package

Fixed

  • LosingPositionsRatioCriterion correct betterThan
  • VersusBuyAndHoldCriterionTest NaN-Error.
  • Fixed ChaikinOscillatorIndicatorTest
  • DecimalNum#remainder() adds NaN-check
  • Fixed ParabolicSarIndicatorTest fixed openPrice always 0 and highPrice lower than lowPrice
  • UlcerIndexIndicator using the max price of current period instead of the highest value of last n bars
  • DurationBarAggregator fixed aggregation of bars with gaps

Changed

  • KeltnerChannelMiddleIndicator changed superclass to AbstractIndicator; add GetBarCount() and toString()
  • KeltnerChannelUpperIndicator add constructor to accept pre-constructed ATR; add GetBarCount() and toString()
  • KeltnerChannelLowerIndicator add constructor to accept pre-constructed ATR; add GetBarCount() and toString()
  • BarSeriesManager removed empty args constructor
  • Open|High|Low|Close do not cache price values anymore
  • DifferenceIndicator(i1,i2) replaced by the more flexible CombineIndicator.minus(i1,i2)
  • DoubleNum replace redundant toString() call in DoubleNum.valueOf(Number i) with i.doubleValue()
  • ZeroCostModel now extends from FixedTransactionCostModel

Removed/Deprecated

  • Num removed Serializable
  • PriceIndicator removed

Added

  • NumericIndicator new class providing a fluent and lightweight api for indicator creation
  • AroonFacade, BollingerBandFacade, KeltnerChannelFacade new classes providing a facade for indicator groups by using lightweight NumericIndicators
  • AbstractEMAIndicator added getBarCount() to support future enhancements
  • ATRIndicator "uncached" by changing superclass to AbstractIndicator; added constructor to accept TRIndicator and getter for same; added toString(); added getBarCount() to support future enhancements
  • :tada: Enhancement added possibility to use CostModels when backtesting with the BacktestExecutor
  • :tada: Enhancement added Num#zero, Num#one, Num#hundred
  • :tada: Enhancement added possibility to use CostModels when backtesting with the BacktestExecutor
  • :tada: Enhancement added Indicator#stream() method
  • :tada: Enhancement added a new CombineIndicator, which can combine the values of two Num Indicators with a given combine-function
  • Example added a json serialization and deserialization example of BarSeries using google-gson library
  • EnterAndHoldCriterion added constructor with TradeType to begin with buy or sell
  • :tada: Enhancement added Position#getStartingType() method
  • :tada: Enhancement added SqnCriterion
  • :tada: Enhancement added StandardDeviationCriterion
  • :tada: Enhancement added RelativeStandardDeviationCriterion
  • :tada: Enhancement added StandardErrorCriterion
  • :tada: Enhancement added VarianceCriterion
  • :tada: Enhancement added AverageCriterion
  • :tada: Enhancement added javadoc for all rules to make clear which rule makes use of a TradingRecord
  • Enhancement prevent Object[] allocation for varargs log.trace and log.debug calls by wrapping them in if blocks
  • :tada: Enhancement added FixedTransactionCostModel
  • :tada: Enhancement added AnalysisCriterion.PositionFilter to handle both sides within one Criterion.

0.14

3 years ago

Release 0.14 of the Ta4j library.

This is the first release via GitHub Releases. Ta4j is also available on the maven central repository

www.ta4j.org

CHANGELOG:

0.14 (released April 25, 2021)

Breaking

  • Breaking: PrecisionNum renamed to DecimalNum
  • Breaking: AverageProfitableTradesCriterion renamed to WinningTradesRatioCriterion
  • Breaking: AverageProfitCriterion renamed to AverageReturnPerBarCriterion
  • Breaking: BuyAndHoldCriterion renamed to BuyAndHoldReturnCriterion
  • Breaking: RewardRiskRatioCriterion renamed to ReturnOverMaxDrawdownCriterion
  • Breaking: ProfitLossCriterion moved to PnL-Package
  • Breaking: ProfitLossPercentageCriterion moved to PnL-Package
  • Breaking: TotalProfitCriterion renamed to GrossReturnCriterion and moved to PnL-Package.
  • Breaking: TotalProfit2Criterion renamed to GrossProfitCriterion and moved to PnL-Package.
  • Breaking: TotalLossCriterion renamed to NetLossCriterion and moved to PnL-Package.
  • Breaking: package "tradereports" renamed to "reports"
  • Breaking: NumberOfTradesCriterion renamed to NumberOfPositionsCriterion
  • Breaking: NumberOfLosingTradesCriterion renamed to NumberOfLosingPositionsCriterion
  • Breaking: NumberOfWinningTradesCriterion renamed to NumberOfWinningPositionsCriterion
  • Breaking: NumberOfBreakEvenTradesCriterion renamed to NumberOfBreakEvenPositionsCriterion
  • Breaking: WinningTradesRatioCriterion renamed to WinningPositionsRatioCriterion
  • Breaking: TradeStatsReport renamed to PositionStatsReport
  • Breaking: TradeStatsReportGenerator renamed to PositionStatsReportGenerator
  • Breaking: TradeOpenedMinimumBarCountRule renamed to OpenedPositionMinimumBarCountRule
  • Breaking: Trade.class renamed to Position.class
  • Breaking: Order.class renamed to Trade.class
  • Breaking: package "tradereports" renamed to "reports"
  • Breaking: package "trading/rules" renamed to "rules"
  • Breaking: remove Serializable from all indicators
  • Breaking: Bar#trades: changed type from int to long

Fixed

  • Fixed Trade: problem with profit calculations on short trades.
  • Fixed TotalLossCriterion: problem with profit calculations on short trades.
  • Fixed BarSeriesBuilder: removed the Serializable interface
  • Fixed ParabolicSarIndicator: problem with calculating in special cases
  • Fixed BaseTimeSeries: can now be serialized
  • Fixed ProfitLossPercentageCriterion: use entryPrice#getValue() instead of entryPrice#getPricePerAsset()

Changed

  • Trade: Changed the way Nums are created.
  • WinningTradesRatioCriterion (previously AverageProfitableTradesCriterion): Changed to calculate trade profits using Trade's getProfit().
  • BuyAndHoldReturnCriterion (previously BuyAndHoldCriterion): Changed to calculate trade profits using Trade's getProfit().
  • ExpectedShortfallCriterion: Removed unnecessary primitive boxing.
  • NumberOfBreakEvenTradesCriterion: Changed to calculate trade profits using Trade's getProfit().
  • NumberOfLosingTradesCriterion: Changed to calculate trade profits using Trade's getProfit().
  • NumberOfWinningTradesCriterion: Changed to calculate trade profits using Trade's getProfit().
  • ProfitLossPercentageCriterion: Changed to calculate trade profits using Trade's entry and exit prices.
  • TotalLossCriterion: Changed to calculate trade profits using Trade's getProfit().
  • TotalReturnCriterion (previously TotalProfitCriterion): Changed to calculate trade profits using Trade's getProfit().
  • WMAIndicator: reduced complexity of WMAIndicator implementation

Removed/Deprecated

  • MultiplierIndicator: replaced by TransformIndicator.
  • AbsoluteIndicator: replaced by TransformIndicator.

Added

  • Enhancement Improvements on gitignore
  • Enhancement Added TradeOpenedMinimumBarCountRule - rule to specify minimum bar count for opened trade.
  • Enhancement Added DateTimeIndicator a new Indicator for dates.
  • Enhancement Added DayOfWeekRule for specifying days of the week to trade.
  • Enhancement Added TimeRangeRule for trading within time ranges.
  • Enhancement Added floor() and ceil() to Num.class
  • Enhancement Added getters getLow() and getUp() in CrossedDownIndicatorRule
  • Enhancement Added BarSeriesUtils: common helpers and shortcuts for BarSeries methods.
  • Enhancement Improvements for PreviousValueIndicator: more descriptive toString() method, validation of n-th previous bars in
  • Enhancement Added Percentage Volume Oscillator Indicator, PVOIndicator.
  • Enhancement Added Distance From Moving Average Indicator, DistanceFromMAIndicator.
  • Enhancement Added Know Sure Thing Indicator, KSTIndicator. constructor of PreviousValueIndicator
  • :tada: Enhancement added getGrossProfit() and getGrossProfit(BarSeries) on Trade.
  • :tada: Enhancement added getPricePerAsset(BarSeries) on Order.
  • :tada: Enhancement added convertBarSeries(BarSeries, conversionFunction) to BarSeriesUtils.
  • :tada: Enhancement added UnstableIndicator.
  • :tada: Enhancement added Chainrule.
  • :tada: Enhancement added BarSeriesUtils#sortBars.
  • :tada: Enhancement added BarSeriesUtils#addBars.
  • :tada: Enhancement added Num.negate() to negate a Num value.
  • :tada: Enhancement added GrossLossCriterion.class.
  • :tada: Enhancement added NetProfitCriterion.class.
  • :tada: Enhancement added chooseBest() method with parameter tradeType in AnalysisCriterion.
  • :tada: Enhancement added AverageLossCriterion.class.
  • :tada: Enhancement added AverageProfitCriterion.class.
  • :tada: Enhancement added ProfitLossRatioCriterion.class.
  • :tada: Enhancement added ExpectancyCriterion.class.
  • :tada: Enhancement added ConsecutiveWinningPositionsCriterion.class.
  • :tada: Enhancement added LosingPositionsRatioCriterion.class
  • :tada: Enhancement added Position#hasProfit.
  • :tada: Enhancement added Position#hasLoss.
  • :tada: Enhancement exposed both EMAs in MACD indicator