New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Indicator.unstablePeriod #918
Conversation
Maybe we should also rename |
ta4j-core/src/main/java/org/ta4j/core/indicators/EMAIndicator.java
Outdated
Show resolved
Hide resolved
added barCount as unstablePeriod
add unstablePeriod
add unstablePeriod
Update DonchianChannelMiddleIndicator.java
add unstablePeriod
Update DonchianChannelUpperIndicator.java
add getUnstablePeriod()
add getUnstablePeriod()
Update SuperTrendIndicator.java
Update SuperTrendUpperBandIndicator.java
add getUnstablePeriod()
Update SuperTrendLowerBandIndicator.java
I am still unsure about this enhancement, especially for indicators that have an unstable period, it should be up to the user to decide when the data of the indicator is useful. For example a user with 190 bars would like to use the Furthermore just adding the |
I thought it should be up to the indicator (and not the user) when the indicator's data is correct. I also thought that if an indicator needs a "warm-up" period (=unstable period), then it is a fixed value that should at least be "documented" (= in the form of
Yes, this PR is only about putting
Yes good idea. We could do this in a new PR after this has been merged (as I also explained in #919 (comment)). But the intention of this PR is only to draw attention to the fact that indicators can have an unstable period and the user can get this automatically by calling a method (= |
Another thing: should we call it |
I would prefer getUnstableBars() |
Replaced by #944 |
Any updates/ETA on this? |
Fixes #.
Changes proposed in this pull request:
add
Indicator#getUnstablePeriod()
added an entry with related ticket number(s) to the unreleased section of
CHANGES.md
The main purpose of the PR is:
Actually, the user must know which value to set for
Strategy#unstablePeriod
. However, this is not easy to know, because the user is not always aware of the technical details of the indicators (e.g. SARIndicator needs at least 200 bars before the values can be calculated correctly, other indicators needs at least its barCount, etc.). It's better to have this information (about the unstablePeriod of an indicator) implemented and documented within each Indicator. The implementor of the indicator must provide this information within the source code of the indicator. With this, the user can retrieve this information (byIndicator#getUnstablePeriod()
) for various use cases.