feat: add math operator wrappers and align TA-Lib binding types
Add Go wrappers for additional TA-Lib math operators: Div, Max, MaxIndex, Min, MinIndex, MinMax, MinMaxIndex, Mult, Sub, and Sum. Refactor the TA-Lib function signatures to use int32 consistently, including taResult and Hilbert Transform bindings, so the Go layer matches the native library more closely. Fix HT_TRENDMODE to return []int32 and update related comments and naming for better API consistency.
This commit is contained in:
@@ -9,7 +9,17 @@ This project currently exposes a small subset of TA-Lib functions:
|
||||
- `HT_PHASOR`
|
||||
- `HT_SINE`
|
||||
- `HT_TRENDMODE`
|
||||
- `ADD`
|
||||
- `Add`
|
||||
- `Div`
|
||||
- `Max`
|
||||
- `MaxIndex`
|
||||
- `Min`
|
||||
- `MinIndex`
|
||||
- `MinMax`
|
||||
- `MinMaxIndex`
|
||||
- `Mult`
|
||||
- `Sub`
|
||||
- `Sum`
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -83,14 +93,18 @@ func main() {
|
||||
period := talib.HT_DCPERIOD(series)
|
||||
fmt.Println(period)
|
||||
|
||||
sum := talib.ADD(series, series)
|
||||
sum := talib.Add(series, series)
|
||||
fmt.Println(sum)
|
||||
|
||||
rollingMax := talib.Max(series, 14)
|
||||
fmt.Println(rollingMax)
|
||||
}
|
||||
```
|
||||
|
||||
## API notes
|
||||
|
||||
- Indicator functions return `nil` when the underlying TA-Lib call fails.
|
||||
- Native TA-Lib functions are exposed with Go-style exported names such as `Add`, `Div`, `Max`, and `Sum`.
|
||||
|
||||
## Project status
|
||||
|
||||
|
||||
Reference in New Issue
Block a user