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:
+133
-31
@@ -3,62 +3,164 @@ package talib
|
||||
// Cycle Indicators (HT) - Hilbert Transform
|
||||
var (
|
||||
ht_dcperiod func(
|
||||
startIdx int,
|
||||
endIdx int,
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
outBegIdx *int,
|
||||
outNBElement *int,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int
|
||||
) int32
|
||||
|
||||
ht_dcphase func(
|
||||
startIdx int,
|
||||
endIdx int,
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
outBegIdx *int,
|
||||
outNBElement *int,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int
|
||||
) int32
|
||||
|
||||
ht_phasor func(
|
||||
startIdx int,
|
||||
endIdx int,
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
outBegIdx *int,
|
||||
outNBElement *int,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outInPhase []float64,
|
||||
outQuadrature []float64,
|
||||
) int
|
||||
) int32
|
||||
|
||||
ht_sine func(
|
||||
startIdx int,
|
||||
endIdx int,
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
outBegIdx *int,
|
||||
outNBElement *int,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outSine []float64,
|
||||
outLeadSine []float64,
|
||||
) int
|
||||
) int32
|
||||
|
||||
ht_trendmode func(
|
||||
startIdx int,
|
||||
endIdx int,
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
outBegIdx *int,
|
||||
outNBElement *int,
|
||||
outInteger []int,
|
||||
) int
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outInteger []int32,
|
||||
) int32
|
||||
)
|
||||
|
||||
// Math Operators
|
||||
var (
|
||||
add func(
|
||||
startIdx int,
|
||||
endIdx int,
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal0 []float64,
|
||||
inReal1 []float64,
|
||||
outBegIdx *int,
|
||||
outNBElement *int,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int
|
||||
) int32
|
||||
|
||||
div func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal0 []float64,
|
||||
inReal1 []float64,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int32
|
||||
|
||||
max func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
optInTimePeriod int32,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int32
|
||||
|
||||
maxIndex func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
optInTimePeriod int32,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outInteger []int32,
|
||||
) int32
|
||||
|
||||
min func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
optInTimePeriod int32,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int32
|
||||
|
||||
minIndex func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
optInTimePeriod int32,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outInteger []int32,
|
||||
) int32
|
||||
|
||||
minMax func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
optInTimePeriod int32,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outMin []float64,
|
||||
outMax []float64,
|
||||
) int32
|
||||
|
||||
minMaxIndex func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
optInTimePeriod int32,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outMinIndex []int32,
|
||||
outMaxIndex []int32,
|
||||
) int32
|
||||
|
||||
mult func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal0 []float64,
|
||||
inReal1 []float64,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int32
|
||||
|
||||
sub func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal0 []float64,
|
||||
inReal1 []float64,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int32
|
||||
|
||||
sum func(
|
||||
startIdx int32,
|
||||
endIdx int32,
|
||||
inReal []float64,
|
||||
optInTimePeriod int32,
|
||||
outBegIdx *int32,
|
||||
outNBElement *int32,
|
||||
outReal []float64,
|
||||
) int32
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user