Skip to content

Commit

Permalink
update adx indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
anywhy committed Mar 23, 2024
1 parent d96013c commit f689b76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/indicator/v2/adx.go
Expand Up @@ -41,12 +41,12 @@ func ADX(source KLineSubscription, window int) *ADXStream {
}

up, dn := k.High.Sub(s.prevHigh), s.prevLow.Sub(k.Low)
if up.Compare(dn) > 0 && up > 0 {
if up.Compare(dn) > 0 && up.Float64() > 0 {
dmp.PushAndEmit(up.Float64())
} else {
dmp.PushAndEmit(0.0)
}
if dn.Compare(up) > 0 && dn > 0 {
if dn.Compare(up) > 0 && dn.Float64() > 0 {
dmn.PushAndEmit(dn.Float64())
} else {
dmn.PushAndEmit(0.0)
Expand Down

0 comments on commit f689b76

Please sign in to comment.