smaSlowValue always undefined
mmaestrini opened this issue · comments
HI, first off thanks for this. I wish I could help on docs - maybe if i get around to understand how this work i might document it :D
I am trying your AO example 1:1 but it's not working. I am passing a dataset i get from tradinview of btc but I get nothing, the result is undefined and I noticed inside the nextValue method , smaFast value do get a value after a couple of entries, but the slow one returns always undefined... Why is that?
This is my code
`const adapter = new TvApiAdapter();
const fastPeriod = 5;
const slowPeriod = 34;
const ao = new indicators.AO(fastPeriod, slowPeriod);
const stochRSI = new indicators.Stochastic();
chart.setMarket(symbol, {
type: 'HeikinAshi',
timeframe: tf,
range: parseInt(size),
});
chart.onSymbolLoaded(() => {
console.log(chart.infos.name, 'loaded !');
});
chart.onUpdate(() => {
// console.log('OK', chart.periods);
chart.periods.forEach((entry) => {
// console.log(entry);
const o = entry.open;
const h = entry.max;
const l = entry.min;
const c = entry.close;
const v = entry.volume;
const aoValue = ao.nextValue(h, l);
const stochRsi = stochRSI.nextValue(h, l, c);
console.log(stochRSI);
// console.log(aoValue); // Accelerator Oscillator calculated value for current candle
});
client.end();
});`
I am not sure how to use this honestly. I would have assumed that passing a dataset to stochastic i would have gotten the stoch rsi value in return but given im not an expert im not sure how to interpret the "fill" smaPeriod, etc etc
Hope you can provide some guidance..
Hi! Can you try to update to latest release, may that helps to you
If does not help, please create demo stand for me with some kind of data (OHLC) and calculations, which i can use as unit test for debugging calculations, thanks
will try in a bit! thanks
can i close the issue?
Inactivity close