You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a bunch of indicators of this module, but the sma always returns me a null no matter what I enter. I am using it the same way I use the ema and wma both work.
` export function SMA(
ohlcv: ccxt.OHLCV[],
period: number,
getLastValue: boolean,
) {
const close = ohlcv.map((candle) => candle[CandleIndex.CLOSE]);
const result = technicalindicators.sma({ values: close, period: period });
I am using a bunch of indicators of this module, but the sma always returns me a null no matter what I enter. I am using it the same way I use the ema and wma both work.
` export function SMA(
ohlcv: ccxt.OHLCV[],
period: number,
getLastValue: boolean,
) {
const close = ohlcv.map((candle) => candle[CandleIndex.CLOSE]);
const result = technicalindicators.sma({ values: close, period: period });
const lastVal = result[result.length - 1];
if (getLastValue)
return {
name: 'SMA',
description: 'Simple Moving Average',
options: { period: period },
result: lastVal,
};
return {
name: 'SMA',
description: 'Simple Moving Average',
options: { period: period },
result: result,
};
}
`
The text was updated successfully, but these errors were encountered: