Files
talib/functions.go
T
beejay 4b07e7c741 feat: add momentum indicators and expand function coverage
Add a full Momentum Indicators category (momentum_indicators.go) with
26 new wrapped functions:

  ADX, ADXR, APO, AROON, AROONOSC, BOP, CCI, CMO, DX, IMI,
  MACD, MACDEXT, MACDFIX, MFI, MOM, MINUS_DI, MINUS_DM,
  PLUS_DI, PLUS_DM, PPO, ROC, ROCP, ROCR, ROCR100, RSI,
  STOCH, STOCHF, STOCHRSI, TRIX, ULTOSC, WILLR

- Register all new native symbols in Load() (loader.go)
- Declare corresponding native function variables in functions.go
- Add MAType enum (ta_ma_type.go) for MA-type parameters (SMA, EMA,
  WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3)
- Add taResult constants (ta_result.go) mirroring TA-Lib return codes
- Each wrapper includes a doc comment with formula, interpretation, and
  known behavioral edge-case notes
2026-07-24 13:37:34 +09:00

674 lines
11 KiB
Go

package talib
// Cycle Indicators (HT) - Hilbert Transform
var (
ht_dcperiod func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
ht_dcphase func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
ht_phasor func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outInPhase []float64,
outQuadrature []float64,
) int32
ht_sine func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outSine []float64,
outLeadSine []float64,
) int32
ht_trendmode func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outInteger []int32,
) int32
)
// Math Operators
var (
add func(
startIdx int32,
endIdx int32,
inReal0 []float64,
inReal1 []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) 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
cos func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
acos func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
cosh func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
sin func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
asin func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
sinh func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
tan func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
atan func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
tanh func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
ceil func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
exp func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
floor func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
sqrt func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
ln func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
log10 func(
startIdx int32,
endIdx int32,
inReal []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
adx func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
adxr func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
apo func(
startIdx int32,
endIdx int32,
inReal []float64,
optInFastPeriod int32,
optInSlowPeriod int32,
optInMAType int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
aroon func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outAroonDown []float64,
outAroonUp []float64,
) int32
aroonosc func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
bop func(
startIdx int32,
endIdx int32,
inOpen []float64,
inHigh []float64,
inLow []float64,
inClose []float64,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
cci func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
cmo func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
dx func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
imi func(
startIdx int32,
endIdx int32,
inOpen []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
macd func(
startIdx int32,
endIdx int32,
inReal []float64,
optInFastPeriod int32,
optInSlowPeriod int32,
optInSignalPeriod int32,
outBegIdx *int32,
outNBElement *int32,
outMACD []float64,
outMACDSignal []float64,
outMACDHist []float64,
) int32
macdext func(
startIdx int32,
endIdx int32,
inReal []float64,
optInFastPeriod int32,
optInFastMAType int32,
optInSlowPeriod int32,
optInSlowMAType int32,
optInSignalPeriod int32,
optInSignalMAType int32,
outBegIdx *int32,
outNBElement *int32,
outMACD []float64,
outMACDSignal []float64,
outMACDHist []float64,
) int32
macdfix func(
startIdx int32,
endIdx int32,
inReal []float64,
optInSignalPeriod int32,
outBegIdx *int32,
outNBElement *int32,
outMACD []float64,
outMACDSignal []float64,
outMACDHist []float64,
) int32
mfi func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
inVolume []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
mom func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
minus_di func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
minus_dm func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
plus_di func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
plus_dm func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
ppo func(
startIdx int32,
endIdx int32,
inReal []float64,
optInFastPeriod int32,
optInSlowPeriod int32,
optInMAType int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
roc func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
rocp func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
rocr func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
rocr100 func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
rsi func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
stoch func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInFastKPeriod int32,
optInSlowKPeriod int32,
optInSlowKMAType int32,
optInSlowDPeriod int32,
optInSlowDMAType int32,
outBegIdx *int32,
outNBElement *int32,
outSlowK []float64,
outSlowD []float64,
) int32
stochf func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInFastKPeriod int32,
optInFastDPeriod int32,
optInFastDMAType int32,
outBegIdx *int32,
outNBElement *int32,
outFastK []float64,
outFastD []float64,
) int32
stochrsi func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
optInFastKPeriod int32,
optInFastDPeriod int32,
optInFastDMAType int32,
outBegIdx *int32,
outNBElement *int32,
outFastK []float64,
outFastD []float64,
) int32
trix func(
startIdx int32,
endIdx int32,
inReal []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
ultosc func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod1 int32,
optInTimePeriod2 int32,
optInTimePeriod3 int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
willr func(
startIdx int32,
endIdx int32,
inHigh []float64,
inLow []float64,
inClose []float64,
optInTimePeriod int32,
outBegIdx *int32,
outNBElement *int32,
outReal []float64,
) int32
)