Closed arquadrado closed 1 year ago
@arquadrado - In case you haven't figured this out by now, you're calling talib.execute
with slightly wrong parameters. inReal
should just be prices
in your case. You don't need to create rsiInput
. MACD is a similar situation. The inReal
key should just be given an Array of numbers.
If you want to customize periods, you pass it in like this:
let rsiResult = await talib.execute({
name: 'RSI',
startIdx: 0,
endIdx: prices.length - 1,
inReal: prices,
optInTimePeriod: 14 // or whatever period you want
})
let macdResult = await talib.execute({
name: 'MACD',
startIdx: 0,
endIdx: prices.length - 1,
inReal: prices,
optInFastPeriod: 12,
optInSlowPeriod: 26,
optInSignalPeriod: 9
})
You can query talib itself to see what parameters these indicators take.
talib.explain('RSI')
talib.explain('MACD')
This issue should be closed, because it's not a bug in talib. You were calling talib.execute
incorrectly.
Hi,
I am trying to use talib to get calculate some indicators but I am encountering problems with that. Both for:
and:
where
prices
is just an array of decimal numbers I am getting the following:I have tried several versions of node and the only one where I could install the library (1.1.5) was with node 12.22.12 but even then I get the above mentioned errors.
Any clue what I might be missing?
Thanks
P.S.: I am running this code in Ubuntu 22.04 LTS.