ta4j icon indicating copy to clipboard operation
ta4j copied to clipboard

Add ChangeIndicator

Open Cypher01 opened this issue 1 year ago • 5 comments

Add ChangeIndicator, coming from my spin-off project ta4j-extended

Cypher01 avatar Oct 23 '24 16:10 Cypher01

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"?

sgflt avatar Oct 24 '24 07:10 sgflt

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.

Cypher01 avatar Oct 24 '24 09:10 Cypher01

OK, but before I need too many changes, is ChangeIndicator fine? Then I'll adapt and rename ClosePriceDifferenceIndicator.

Cypher01 avatar Oct 30 '24 20:10 Cypher01

OK, but before I need too many changes, is ChangeIndicator fine? Then I'll adapt and rename ClosePriceDifferenceIndicator.

Yes, everything else is fine.

TheCookieLab avatar Nov 04 '24 15:11 TheCookieLab

@Cypher01 are you still planning on making these changes or should I run with it?

TheCookieLab avatar Feb 26 '25 16:02 TheCookieLab

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.

nimo23 avatar Jun 26 '25 15:06 nimo23

@TheCookieLab It's not okay to close this without informing the community why. This isn't how an organization member should behave ..

nimo23 avatar Jul 14 '25 19:07 nimo23

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.

Cypher01 avatar Jul 15 '25 07:07 Cypher01