ta4j
ta4j copied to clipboard
Add ChangeIndicator
I slightly feel overlap between new BinaryOperation(Num::minus, left, right) + PreviousValueIndicator and this indicator.
new BinaryOperation(Num::minus, indicator, new PreviousValueIndicator(indicator, barCount)
Wouldn't be better to reuse them as a named wrapper "ChangeIndicator"?
Good point, I just realized there is an even simpler implementation.
CombineIndicator.minus(indicator, new PreviousValueIndicator(indicator, barCount))
This indicator could still be helpful for its convenient constructors, but the code/calculation is very simple. I'll update the implementation, but I would also be fine if this PR gets declined.
OK, but before I need too many changes, is ChangeIndicator fine? Then I'll adapt and rename ClosePriceDifferenceIndicator.
OK, but before I need too many changes, is
ChangeIndicatorfine? Then I'll adapt and renameClosePriceDifferenceIndicator.
Yes, everything else is fine.
@Cypher01 are you still planning on making these changes or should I run with it?
There is a lot of overlap in functionality with the existing
ClosePriceDifferenceIndicator. Rather than a new class can fold these changes into the existing class by:Allowing an arbitrary indicator (rather than the currently hard-coded ClosePriceIndicator) Introducing the barCount flexibility Re-name accordingly
@TheCookieLab Please provide a PR with your suggestions.
@TheCookieLab It's not okay to close this without informing the community why. This isn't how an organization member should behave ..
I didn't respond for a while, I don't have time for that at the moment. I will create another PR when I find time.