Releases: ta4j/ta4j
Releases Β· ta4j/ta4j
Release 0.16
Release 0.16 of the Ta4j library.
This is the third release via GitHub Releases. Ta4j is also available on the maven central repository
Changelog for ta4j
, roughly following keepachangelog.com from version 0.9 onwards.
0.16 (released May 15, 2024)
Breaking
- Upgraded to Java 11
- VersusBuyAndHoldCriterion renamed to
VersusEnterAndHoldCriterion
- BarSeries constructors use any instance of Num instead of Num-Function
- GrossReturnCriterion renamed to
ReturnCriterion
- NetProfitCriterion and GrossProfitCriterion replaced by
ProfitCriterion
- NetLossCriterion and GrossLossCriterion replaced by
LossCriterion
- LosingPositionsRatioCriterion replaced by
PositionsRatioCriterion
- WinningPositionsRatioCriterion replaced by
PositionsRatioCriterion
- Strategy#unstablePeriod renamed to
Strategy#unstableBars*
- DateTimeIndicator moved to package
indicators/helpers
- UnstableIndicator moved to package
indicators/helpers
- ConvertableBaseBarBuilder renamed to
BaseBarConvertableBuilder
- BarSeriesManager updated to use
TradeOnNextOpenModel
by default, which opens new trades at indext + 1
at the open price.- For strategies require the previous behaviour, i.e. trades seconds or minutes before the closing prices,
TradeOnCurerentCloseModel
can be passed to BarSeriesManager- For example:
BarSeriesManager manager = new BarSeriesManager(barSeries, new TradeOnCurrentCloseModel())
BarSeriesManager manager = new BarSeriesManager(barSeries, transactionCostModel, holdingCostModel, tradeExecutionModel)
- For example:
- For strategies require the previous behaviour, i.e. trades seconds or minutes before the closing prices,
- BarSeriesManager and BacktestExecutor moved to packge
backtest
- BarSeries#getBeginIndex() methode returns correct begin index for bar series with max bar count
Fixed
- Fixed SuperTrendIndicator fixed calculation when close price is the same as the previous Super Trend indicator value
- Fixed ParabolicSarIndicator fixed calculation for sporadic indices
- ExpectancyCriterion fixed calculation
- catch NumberFormatException if
DecimalNum.valueOf(Number)
isNaN
- ProfitCriterion fixed excludeCosts functionality as it was reversed
- LossCriterion fixed excludeCosts functionality as it was reversed
- PerformanceReportGenerator fixed netProfit and netLoss calculations to include costs
- DifferencePercentageIndicator fixed re-calculate instance variable on every iteration
- ThreeWhiteSoldiersIndicator fixed eliminated instance variable holding possible wrong value
- ThreeBlackCrowsIndicator fixed eliminated instance variable holding possible wrong value
- TrailingStopLossRule removed instance variable
currentStopLossLimitActivation
because it may not be alway the correct (last) value - sets
ClosePriceDifferenceIndicator#getUnstableBars
=1
- sets
ClosePriceRatioIndicator#getUnstableBars
=1
- sets
ConvergenceDivergenceIndicator#getUnstableBars
=barCount
- sets
GainIndicator#getUnstableBars
=1
- sets
HighestValueIndicator#getUnstableBars
=barCount
- sets
LossIndicator#getUnstableBars
=1
- sets
LowestValueIndicator#getUnstableBars
=barCount
- sets
TRIndicator#getUnstableBars
=1
- sets
PreviousValueIndicator#getUnstableBars
=n
(= the n-th previous index) - PreviousValueIndicator returns
NaN
if the (n-th) previous value of an indicator does not exist, i.e. if the (n-th) previous is below the first available index. - EnterAndHoldReturnCriterion fixes exception thrown when bar series was empty
- BaseBarSeries fixed
UnsupportedOperationException
when creating a bar series that is based on an unmodifiable collection - Num implements Serializable
Changed
- BarSeriesManager consider finishIndex when running backtest
- BarSeriesManager add
holdingTransaction
- BacktestExecutor evaluates strategies in parallel when possible
- CachedIndicator synchronize on getValue()
- BaseBar defaults to
DecimalNum
type in all constructors - TRIndicator improved calculation
- WMAIndicator improved calculation
- KSTIndicator improved calculation
- RSIIndicator simplify calculation
- FisherIndicator improved calculation
- DoubleEMAIndicator improved calculation
- CMOIndicator improved calculation
- PearsonCorrelationIndicator improved calculation
- PivotPoint-Indicators improved calculations
- ValueAtRiskCriterion improved calculation
- ExpectedShortfallCriterion improved calculation
- SqnCriterion improved calculation
- NumberOfBreakEvenPositionsCriterion shorten code
- AverageReturnPerBarCriterion improved calculation
- ZLEMAIndicator improved calculation
- InPipeRule improved calculation
- SumIndicator improved calculation
- updated pom.xml: slf4j-api to 2.0.7
- updated pom.xml: org.apache.poi to 5.2.3
- updated pom.xml: maven-jar-plugin to 3.3.0
- add
final
to properties where possible - improved javadoc
- SuperTrendIndicator,SuperTrendUpperIndicator,SuperTrendLowerIndicator: optimized calculation
- SuperTrendIndicator, SuperTrendLowerBandIndicator, SuperTrendUpperBandIndicator:
multiplier
changed to fromInteger
toDouble
- add missing
@Override
annotation - RecursiveCachedIndicator: simplified code
- LossIndicator: optimize calculation
- GainIndicator: improved calculation
- PriceVariationIndicator renamed to ClosePriceRatioIndicator for consistency with new ClosePriceDifferenceIndicator
- made UnaryOperation and BinaryOperation public
Removed/Deprecated
- removed Serializable from
CostModel
- removed
@Deprecated Bar#addTrade(double tradeVolume, double tradePrice, Function<Number, Num> numFunction)
; useBar#addTrade(Num tradeVolume, Num tradePrice)
instead. - removed
@Deprecated Bar#addTrade(String tradeVolume, String tradePrice, Function<Number, Num> numFunction)
; useBar#addTrade(Num tradeVolume, Num tradePrice)
instead. - removed
DecimalNum.valueOf(DecimalNum)
- delete
.travis.yml
as this project is managed by "Github actions"
Added
- added
TradingRecord.getStartIndex()
andTradingRecord.getEndIndex()
to track start and end of the recording - added SuperTrendIndicator
- added SuperTrendUpperBandIndicator
- added SuperTrendLowerBandIndicator
- added Donchian Channel indicators (Upper, Lower, and Middle)
- added
Indicator.getUnstableBars()
- added
TransformIndicator.pow()
- added
BarSeriesManager.getHoldingCostModel()
andBarSeriesManager.getTransactionCostModel()
to allow extending BarSeriesManager and reimplementingrun()
- added
MovingAverageCrossOverRangeBacktest.java
andETH-USD-PT5M-2023-3-13_2023-3-15.json
test data file to demonstrate parallel strategy evaluation - added javadoc improvements for percentage criteria
- added "lessIsBetter"-property for AverageCriterion
- added "lessIsBetter"-property for RelativeStandardDeviation
- added "lessIsBetter"-property for StandardDeviationCriterion
- added "lessIsBetter"-property for StandardErrorCriterion
- added "lessIsBetter"-property for VarianceCriterion
- added "lessIsBetter"-property for NumberOfPositionsCriterion
- added "addBase"-property for ReturnCriterion to include or exclude the base percentage of 1
- added RelativeVolumeStandardDeviationIndicator
- added MoneyFlowIndexIndicator
- added IntraDayMomentumIndexIndicator
- added ClosePriceDifferenceIndicator
- added TimeSegmentedVolumeIndicator
- added
DecimalNum.valueOf(DoubleNum)
to convert a DoubleNum to a DecimalNum. - added
DoubleNum.valueOf(DecimalNum)
to convert a DecimalNum to a DoubleNum. - added "TradeExecutionModel" to modify trade execution during backtesting
- added NumIndicator to calculate any
Num
-value for aBar
- added RunningTotalIndicator to calculate a cumulative sum for a period.
Fixed
- Fixed CashFlow fixed calculation with custom startIndex and endIndex
- Fixed Returns fixed calculation with custom startIndex and endIndex
- Fixed ExpectedShortfallCriterion fixed calculation with custom startIndex and endIndex
- Fixed MaximumDrawDownCriterion fixed calculation with custom startIndex and endIndex
- Fixed EnterAndHoldReturnCriterion fixed calculation with custom startIndex and endIndex
- Fixed VersusEnterAndHoldCriterion fixed calculation with custom startIndex and endIndex
- Fixed BarSeriesManager consider finishIndex when running backtest
Release 0.15
Release 0.15 of the Ta4j library.
This is the second release via GitHub Releases. Ta4j is also available on the maven central repository
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 rootcost
-package moved toanalysis/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 inDoubleNum.valueOf(Number i)
withi.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
- π Enhancement added possibility to use CostModels when backtesting with the BacktestExecutor
- π Enhancement added Num#zero, Num#one, Num#hundred
- π Enhancement added possibility to use CostModels when backtesting with the BacktestExecutor
- π Enhancement added Indicator#stream() method
- π 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
- π Enhancement added Position#getStartingType() method
- π Enhancement added
SqnCriterion
- π Enhancement added
StandardDeviationCriterion
- π Enhancement added
RelativeStandardDeviationCriterion
- π Enhancement added
StandardErrorCriterion
- π Enhancement added
VarianceCriterion
- π Enhancement added
AverageCriterion
- π 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 - π Enhancement added
FixedTransactionCostModel
- π Enhancement added
AnalysisCriterion.PositionFilter
to handle both sides within one Criterion.
Release 0.14
Release 0.14 of the Ta4j library.
This is the first release via GitHub Releases. Ta4j is also available on the maven central repository
CHANGELOG:
0.14 (released April 25, 2021)
Breaking
- Breaking:
PrecisionNum
renamed toDecimalNum
- Breaking:
AverageProfitableTradesCriterion
renamed toWinningTradesRatioCriterion
- Breaking:
AverageProfitCriterion
renamed toAverageReturnPerBarCriterion
- Breaking:
BuyAndHoldCriterion
renamed toBuyAndHoldReturnCriterion
- Breaking:
RewardRiskRatioCriterion
renamed toReturnOverMaxDrawdownCriterion
- Breaking:
ProfitLossCriterion
moved to PnL-Package - Breaking:
ProfitLossPercentageCriterion
moved to PnL-Package - Breaking:
TotalProfitCriterion
renamed toGrossReturnCriterion
and moved to PnL-Package. - Breaking:
TotalProfit2Criterion
renamed toGrossProfitCriterion
and moved to PnL-Package. - Breaking:
TotalLossCriterion
renamed toNetLossCriterion
and moved to PnL-Package. - Breaking: package "tradereports" renamed to "reports"
- Breaking:
NumberOfTradesCriterion
renamed toNumberOfPositionsCriterion
- Breaking:
NumberOfLosingTradesCriterion
renamed toNumberOfLosingPositionsCriterion
- Breaking:
NumberOfWinningTradesCriterion
renamed toNumberOfWinningPositionsCriterion
- Breaking:
NumberOfBreakEvenTradesCriterion
renamed toNumberOfBreakEvenPositionsCriterion
- Breaking:
WinningTradesRatioCriterion
renamed toWinningPositionsRatioCriterion
- Breaking:
TradeStatsReport
renamed toPositionStatsReport
- Breaking:
TradeStatsReportGenerator
renamed toPositionStatsReportGenerator
- Breaking:
TradeOpenedMinimumBarCountRule
renamed toOpenedPositionMinimumBarCountRule
- Breaking:
Trade.class
renamed toPosition.class
- Breaking:
Order.class
renamed toTrade.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 - π Enhancement added getGrossProfit() and getGrossProfit(BarSeries) on Trade.
- π Enhancement added getPricePerAsset(BarSeries) on Order.
- π Enhancement added convertBarSeries(BarSeries, conversionFunction) to BarSeriesUtils.
- π Enhancement added UnstableIndicator.
- π Enhancement added Chainrule.
- π Enhancement added BarSeriesUtils#sortBars.
- π Enhancement added BarSeriesUtils#addBars.
- π Enhancement added Num.negate() to negate a Num value.
- π Enhancement added
GrossLossCriterion.class
. - π Enhancement added
NetProfitCriterion.class
. - π Enhancement added chooseBest() method with parameter tradeType in AnalysisCriterion.
- π Enhancement added
AverageLossCriterion.class
. - π Enhancement added
AverageProfitCriterion.class
. - π Enhancement added
ProfitLossRatioCriterion.class
. - π Enhancement added
ExpectancyCriterion.class
. - π Enhancement added
ConsecutiveWinningPositionsCriterion.class
. - π Enhancement added
LosingPositionsRatioCriterion.class
- π Enhancement added Position#hasProfit.
- π Enhancement added Position#hasLoss.
- π Enhancement exposed both EMAs in MACD indicator