How to contribute - edlins/ta4j GitHub Wiki

What is a contribution?

In our terms a contribution is already to share a good analysed bug report Found a bug? If you want to go deeper and you want to contribute test cases, e.g. for a quality contribution (identify a bug) or to help us to keep the lib clean and stable. Or you have even a nice idea, which you would like to contribute as code? You are always welcome. We suggest you before you contribute a bigger work to get prior permission, since we want to verify first if the contribution will bring the lib forward. We will give quickly a feedback if we will accept the contribution.


How to contribute?

In the most cases (e.g. bug fixes and little enhancements) you can create a pull request to the develop branch. For bigger improvements please open an issue to discuss your plans.

  • Note: Pull requests to the master branch will not be accepted
  • Note: Pull requests with respect to items of the Roadmap are very welcome!

You can fork and clone the repository and set up the develop branch:

// fork repositroy on Git UI from https://github.com/ta4j/ta4j.git to https://github.com/yourAccount/ta4j.git

git clone https://github.com/yourAccount/ta4j.git
cd ta4j
git remote add develop https://github.com/yourAccount/ta4j.git
git checkout develop

If necessary and coordinated, you can also create a new feature branch for bigger enhancements:

git checkout -b feature/name-of-your-feature-branch
git push --set-upstream origin feature/*
  • Note: If you have finished your work, please make sure to maintain the CHANGELOG.md file if you have added, fixed or enhanced something.
git add myNewFiles.java CHANGELOG.md 
git commit
git push

The last step would be to do a pull request from your branch to the develop branch of the ta4j repository. If you want to do a pull-request, the best way is to do is via Git UI:

Coding rules and conventions

General

(in progress..) First things first: Feel free to write awesome code! Do not hesitate to open an issue or a pull request just because you fear making a mistake. Others can review your code, give you tips and can correct you.

  • Be aware that your code is easily legible and transparent.
  • Stay in scope of your pull request. Do not make changes all over the project in one pull request. For example if you want to add a new indicator add but you also found bugs or little enhancements on TimeSeries and TrandingRecord fix them in a new pull request.

hints

  • use int startIndex = timeSeries.getBeginIndex() instead of int startIndex = 0 to get the first valid index of a TimeSeries.
  • Note the difference between Decimal.min(other) and Decimal.minus(other)

Indicators

(in progress..) If you want to add a new indicator to this repository, please open an issue first to discuss your plans.

  • Every indicator needs a test class in the corresponding package:
    • src -> main -> java -> org -> ta4j -> core -> indicators -> NewIndicator.java
    • src -> test -> java -> org -> ta4j -> core -> indicators -> NewIndicatorTest.java